Skip to content

Commit d44a34a

Browse files
committed
build(release): 使用 UPX 压缩 Windows 可执行文件体积
1 parent 01d7b03 commit d44a34a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.github/release_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 更新日志
2+
13
## 文件下载
24

35
| 平台 | 文件名 |

.github/workflows/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ jobs:
3535
python -m pip install --upgrade pip
3636
pip install -r requirements.txt pyinstaller
3737
38+
- name: Install UPX (Windows)
39+
if: runner.os == 'Windows'
40+
shell: pwsh
41+
run: |
42+
choco install upx -y
43+
echo "UPX_PATH=C:\ProgramData\chocolatey\bin" >> $env:GITHUB_ENV
44+
45+
# - name: Install UPX (Linux) (not used)
46+
# if: runner.os == 'Linux'
47+
# run: |
48+
# sudo apt-get update
49+
# sudo apt-get install -y upx
50+
51+
# - name: Install UPX (macOS) (not used)
52+
# if: runner.os == 'macOS'
53+
# run: |
54+
# brew install upx
55+
3856
- name: Build executable with PyInstaller
3957
run: |
4058
pyinstaller --name TingJu --onedir --icon "${{ github.workspace }}/static/img/icon.ico" --distpath ./dist --workpath ./build --specpath ./spec app.py

0 commit comments

Comments
 (0)