Skip to content

Commit 9904a01

Browse files
committed
ci(workflow): 优化发布工作流的版本输入和UPX压缩逻辑
1 parent d9e6a76 commit 9904a01

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ on:
77
workflow_dispatch:
88
inputs:
99
version:
10-
description: "Version to release (e.g., v1.0.0)"
11-
required: true
12-
default: "v1.0.0"
10+
description: "Version to release (e.g., v1.0.0). Leave empty to auto-bump from latest tag."
11+
required: false
12+
default: ""
1313

1414
jobs:
1515
build:
@@ -87,13 +87,18 @@ jobs:
8787
echo "构建文件:"
8888
ls -lh release/cert-deploy-*
8989
90-
- name: Compress with UPX
90+
- name: Compress Linux binaries with UPX
9191
run: |
92-
echo "开始 UPX 压缩..."
93-
upx --best release/cert-deploy-*
94-
echo "压缩完成"
92+
echo "开始压缩 Linux 版本..."
93+
for f in release/cert-deploy-linux release/cert-deploy-linux-arm64; do
94+
if [ -f "$f" ]; then
95+
echo "UPX 压缩: $f"
96+
upx --best "$f" || echo "⚠️ 压缩失败(已忽略): $f"
97+
fi
98+
done
99+
echo "✅ Linux 压缩完成"
95100
echo "压缩后文件大小:"
96-
ls -lh release/cert-deploy-*
101+
ls -lh release/cert-deploy-linux*
97102
98103
- name: Create release packages
99104
run: |

0 commit comments

Comments
 (0)