From 2a679e88a42e52b5af79b66cf25ac1238db96740 Mon Sep 17 00:00:00 2001 From: Fox_block Date: Sat, 21 Mar 2026 18:58:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20release=20=E4=BA=A7?= =?UTF-8?q?=E7=89=A9=E6=94=B6=E9=9B=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新产物路径以匹配 Tauri 2.x 的 target-specific 输出目录 - Windows: 添加 x86_64-pc-windows-msvc 路径 - macOS: 添加 x86_64/aarch64/universal 路径 - Linux: 添加 x86_64-unknown-linux-gnu 路径 - 更新 release job 的文件匹配模式,使用具体的 artifact 目录 - 添加调试步骤列出所有产物文件 - 修复 release job 的条件判断,正确处理 skipped 状态的构建任务 --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0445ec..2897f60 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,7 +89,9 @@ jobs: - uses: actions/upload-artifact@v4 with: name: dist-win - path: src-tauri/target/release/bundle/** + path: | + src-tauri/target/x86_64-pc-windows-msvc/release/bundle/** + src-tauri/target/release/bundle/** build_mac: needs: parse @@ -123,7 +125,11 @@ jobs: - uses: actions/upload-artifact@v4 with: name: dist-mac - path: src-tauri/target/release/bundle/** + path: | + src-tauri/target/x86_64-apple-darwin/release/bundle/** + src-tauri/target/aarch64-apple-darwin/release/bundle/** + src-tauri/target/universal-apple-darwin/release/bundle/** + src-tauri/target/release/bundle/** build_linux: needs: parse @@ -160,7 +166,9 @@ jobs: - uses: actions/upload-artifact@v4 with: name: dist-linux - path: src-tauri/target/release/bundle/** + path: | + src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/** + src-tauri/target/release/bundle/** build_android: needs: parse @@ -218,12 +226,18 @@ jobs: release: needs: [parse, build_win, build_mac, build_linux, build_android] - if: ${{ always() && needs.parse.outputs.tag != '' }} + if: ${{ always() && needs.parse.outputs.tag != '' && (needs.build_win.result == 'success' || needs.build_win.result == 'skipped') && (needs.build_mac.result == 'success' || needs.build_mac.result == 'skipped') && (needs.build_linux.result == 'success' || needs.build_linux.result == 'skipped') && (needs.build_android.result == 'success' || needs.build_android.result == 'skipped') }} runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4 with: path: artifacts + merge-multiple: true + + - name: 列出产物文件 + run: | + echo "Artifacts found:" + find artifacts -type f -name "*.msi" -o -name "*.exe" -o -name "*.dmg" -o -name "*.app.tar.gz" -o -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" -o -name "*.apk" 2>/dev/null || true - name: 发布 Release uses: softprops/action-gh-release@v2 @@ -233,11 +247,11 @@ jobs: draft: True prerelease: ${{ contains(needs.parse.outputs.version, '-') }} files: | - artifacts/**/*.msi - artifacts/**/*.exe - artifacts/**/*.dmg - artifacts/**/*.app.tar.gz - artifacts/**/*.deb - artifacts/**/*.rpm - artifacts/**/*.AppImage - artifacts/**/*.apk + artifacts/dist-win/**/*.msi + artifacts/dist-win/**/*.exe + artifacts/dist-mac/**/*.dmg + artifacts/dist-mac/**/*.app.tar.gz + artifacts/dist-linux/**/*.deb + artifacts/dist-linux/**/*.rpm + artifacts/dist-linux/**/*.AppImage + artifacts/dist-android/**/*.apk