File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import requests
2+ import os
3+
4+ # Get the latest version of UPX from GitHub
5+ apiURL = "https://api.github.com/repos/upx/upx/releases/latest"
6+
7+ for _ in range (5 ):
8+ try :
9+ req = requests .get (apiURL )
10+ latestDownloadURL = [each ['browser_download_url' ] for each in req .json ()['assets' ] if 'win64' in each ['name' ]][0 ]
11+ print (f'Latest UPX download URL: { latestDownloadURL } ' )
12+ break
13+ except KeyError :
14+ continue
15+ else :
16+ print ('Use old UPX download URL instead.' )
17+ latestDownloadURL = 'https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-win64.zip'
18+
19+ os .system (f'certutil -urlcache -split -f { latestDownloadURL } upx.zip' )
Original file line number Diff line number Diff line change @@ -24,19 +24,19 @@ jobs:
2424 run : pip install -r requirements.txt ; python -m unidic download ;
2525
2626 - name : dl upx
27- run : certutil -urlcache -split -f https:// github.com/upx/upx/releases/download/v3.96/upx-3.96-win64.zip upx.zip ; 7z x upx.zip
27+ run : python . github\getLatestUPX.py ; 7z x upx.zip; mv upx-* upx;
2828
2929 - name : pack:full
30- run : pyinstaller --upx-dir upx-3.96-win64 TransAssistant_full.spec -y ; mv dist/TransAssistant_full ./ ; 7z a -t7z TransAssistant_full.7z TransAssistant_full
30+ run : pyinstaller --upx-dir upx TransAssistant_full.spec -y ; mv dist/TransAssistant_full ./ ; 7z a -t7z TransAssistant_full.7z TransAssistant_full
3131
3232 - name : pack:core
33- run : pyinstaller --upx-dir upx-3.96-win64 TransAssistant_core.spec -y ; mv dist/TransAssistant_core ./ ; 7z a -t7z TransAssistant_core.7z TransAssistant_core
33+ run : pyinstaller --upx-dir upx TransAssistant_core.spec -y ; mv dist/TransAssistant_core ./ ; 7z a -t7z TransAssistant_core.7z TransAssistant_core
3434
3535 - name : pack:core-lite
36- run : pyinstaller --upx-dir upx-3.96-win64 TransAssistant_core-lite.spec -y ; mv dist/TransAssistant_core-lite ./ ; 7z a -t7z TransAssistant_core-lite.7z TransAssistant_core-lite
36+ run : pyinstaller --upx-dir upx TransAssistant_core-lite.spec -y ; mv dist/TransAssistant_core-lite ./ ; 7z a -t7z TransAssistant_core-lite.7z TransAssistant_core-lite
3737
3838 - name : pack:small
39- run : pyinstaller --upx-dir upx-3.96-win64 TransAssistant_small.spec -y ; mv dist/TransAssistant_small ./ ; 7z a -t7z TransAssistant_small.7z TransAssistant_small
39+ run : pyinstaller --upx-dir upx TransAssistant_small.spec -y ; mv dist/TransAssistant_small ./ ; 7z a -t7z TransAssistant_small.7z TransAssistant_small
4040
4141 - name : upload
4242 uses : actions/upload-artifact@v3
You can’t perform that action at this time.
0 commit comments