Skip to content

Commit

Permalink
ci: simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
itsHenry35 committed Sep 29, 2024
1 parent ae18c60 commit ea94e6b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ jobs:
- name: Build and rename the artifact
run: |
pyinstaller --noconfirm --onefile --console --icon "D:/a/ledu/ledu/ledu.ico" --add-data "D:/a/ledu/ledu/bin/aria2c_win32_x64.exe;bin/" --add-data "D:/a/ledu/ledu/bin/aria2_win32.conf;bin/" "D:/a/ledu/ledu/main.py"
pyinstaller --noconfirm --onefile --console --icon "ledu.ico" --add-data "bin/aria2c_win32_x64.exe;bin/" --add-data "bin/aria2_win32.conf;bin/" "main.py"
$SHORT_COMMIT_ID = $env:GITHUB_SHA.Substring(0,7)
if ($env:GITHUB_EVENT_NAME -eq "pull_request") {
$FILENAME = "ledu_download_win64_PR_$($SHORT_COMMIT_ID).exe"
} else {
$FILENAME = "ledu_download_win64_$($SHORT_COMMIT_ID).exe"
}
ren D:\a\ledu\ledu\dist\main.exe D:\a\ledu\ledu\dist\$FILENAME
ren .\dist\main.exe $FILENAME
- name: Upload
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -66,14 +66,14 @@ jobs:
- name: Build and rename the artifact
run: |
pyinstaller --noconfirm --onefile --console --icon "/home/runner/work/ledu/ledu/ledu.ico" --add-data "/home/runner/work/ledu/ledu/bin/aria2c_linux_x64:bin/" --add-data "/home/runner/work/ledu/ledu/bin/aria2_linux.conf:bin/" "/home/runner/work/ledu/ledu/main.py"
pyinstaller --noconfirm --onefile --console --icon "ledu.ico" --add-data "bin/aria2c_linux_x64:bin/" --add-data "bin/aria2_linux.conf:bin/" "main.py"
SHORT_COMMIT_ID=${GITHUB_SHA::7}
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
FILENAME=ledu_download_linux_amd64_pr_$SHORT_COMMIT_ID
else
FILENAME=ledu_download_linux_amd64_$SHORT_COMMIT_ID
fi
mv /home/runner/work/ledu/ledu/dist/main /home/runner/work/ledu/ledu/dist/$FILENAME
mv dist/main dist/$FILENAME
- name: Upload
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -101,14 +101,14 @@ jobs:
- name: Build and compress the artifact
run: |
pyinstaller --noconfirm --onefile --console --icon "/Users/runner/work/ledu/ledu/ledu.ico" --add-data "/Users/runner/work/ledu/ledu/bin/aria2c_darwin_x64:bin/" --add-data "/Users/runner/work/ledu/ledu/bin/aria2_darwin.conf:bin/" "/Users/runner/work/ledu/ledu/main.py"
pyinstaller --noconfirm --onefile --console --icon "ledu.ico" --add-data "bin/aria2c_darwin_arm64:bin/" --add-data "bin/aria2_darwin.conf:bin/" "main.py"
SHORT_COMMIT_ID=${GITHUB_SHA::7}
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
FILENAME=ledu_download_macos_pr_$SHORT_COMMIT_ID
else
FILENAME=ledu_download_macos_$SHORT_COMMIT_ID
fi
mv /Users/runner/work/ledu/ledu/dist/main /Users/runner/work/ledu/ledu/dist/$FILENAME
mv dist/main dist/$FILENAME
- name: Upload
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
else
FILENAME=ledu_download_macos_$SHORT_COMMIT_ID
fi
mv /Users/runner/work/ledu/ledu/dist/main /Users/runner/work/ledu/ledu/dist/$FILENAME
mv dist/main dist/$FILENAME
- name: Upload
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit ea94e6b

Please sign in to comment.