Skip to content

Commit 2042bff

Browse files
committed
fix:修复匹配机制
1 parent ce0180d commit 2042bff

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ jobs:
120120
FYNE_BUILD_FLAGS: "-trimpath -ldflags '-s -w'"
121121
run: |
122122
fyne package --os android/amd64 --app-id com.oneclickvirt.goecs --app-version "${{ needs.prepare.outputs.app_version }}" --release
123-
if [ -f *.apk ]; then
124-
mv *.apk goecs-gui-android-x86_64-${{ needs.prepare.outputs.version }}.apk
123+
# 查找新生成的 APK(排除已重命名的 arm64 版本)
124+
NEW_APK=$(find . -maxdepth 1 -name "*.apk" -not -name "goecs-gui-android-*" -type f | head -n 1)
125+
if [ -n "$NEW_APK" ]; then
126+
mv "$NEW_APK" goecs-gui-android-x86_64-${{ needs.prepare.outputs.version }}.apk
125127
echo "x86_64 APK 构建成功"
126128
ls -lh goecs-gui-android-x86_64-${{ needs.prepare.outputs.version }}.apk
127129
else
@@ -275,12 +277,10 @@ jobs:
275277
run: |
276278
if [ "${{ runner.os }}" == "macOS" ]; then
277279
brew install upx
280+
upx --version
278281
elif [ "${{ runner.os }}" == "Windows" ]; then
279-
curl -L https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-win64.zip -o upx.zip
280-
unzip upx.zip
281-
echo "$PWD/upx-4.2.1-win64" >> $GITHUB_PATH
282+
echo "跳过 Windows UPX 安装(不支持)"
282283
fi
283-
upx --version
284284
285285
- name: Build for ${{ matrix.name }}
286286
env:
@@ -324,16 +324,17 @@ jobs:
324324
- name: Compress with UPX
325325
shell: bash
326326
run: |
327+
# Windows 跳过 UPX 压缩
328+
if [ "${{ runner.os }}" == "Windows" ]; then
329+
echo "跳过 Windows exe 的 UPX 压缩(不支持)"
330+
exit 0
331+
fi
332+
327333
for file in goecs-gui-${{ matrix.name }}-*; do
328334
if [ -f "$file" ]; then
329335
echo "压缩前大小: $(du -h "$file")"
330336
331-
if [[ "$file" == *.exe ]]; then
332-
# Windows exe 直接压缩
333-
echo "正在压缩 Windows exe: $file"
334-
upx --best --lzma "$file" || echo "警告: $file 压缩失败"
335-
echo "压缩后大小: $(du -h "$file")"
336-
elif [[ "$file" == *.tar.gz ]]; then
337+
if [[ "$file" == *.tar.gz ]]; then
337338
# macOS app 需要解压后压缩二进制
338339
echo "正在处理 macOS app: $file"
339340
tar -xzf "$file"

0 commit comments

Comments
 (0)