From 8073f23263da04b7f0233b9f47791e794efe84ab Mon Sep 17 00:00:00 2001 From: coso Date: Fri, 16 Jan 2026 18:28:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E4=BF=AE=E5=A4=8D=20Windows=20?= =?UTF-8?q?=E5=92=8C=20Linux=20=E6=9E=84=E5=BB=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Windows: 使用 PowerShell 语法替代 rm -rf - Linux: 安装 libssl-dev 并设置 OPENSSL_NO_VENDOR 使用系统 OpenSSL 避免 OpenSSL 源码编译时的汇编器兼容性问题 --- .github/workflows/release.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 414e1da9a..19edfcea5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,7 +65,7 @@ jobs: if: matrix.platform == 'ubuntu-22.04' run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev pkg-config - name: Setup Rust uses: dtolnay/rust-toolchain@stable @@ -120,6 +120,8 @@ jobs: CARGO_INCREMENTAL: 0 SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: sccache + # Linux 使用系统 OpenSSL + OPENSSL_NO_VENDOR: ${{ matrix.platform == 'ubuntu-22.04' && '1' || '' }} # Apple 签名环境变量 APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} @@ -156,7 +158,8 @@ jobs: args: --target ${{ matrix.target }} # 构建后清理,节省缓存空间 - - name: Post-build cleanup + - name: Post-build cleanup (Unix) + if: matrix.platform != 'windows-latest' run: | rm -rf src-tauri/target/release/deps || true rm -rf src-tauri/target/release/build || true @@ -165,6 +168,17 @@ jobs: rm -rf src-tauri/target/${{ matrix.target }}/release/build || true rm -rf src-tauri/target/${{ matrix.target }}/release/incremental || true + - name: Post-build cleanup (Windows) + if: matrix.platform == 'windows-latest' + shell: pwsh + run: | + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue src-tauri/target/release/deps + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue src-tauri/target/release/build + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue src-tauri/target/release/incremental + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue src-tauri/target/${{ matrix.target }}/release/deps + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue src-tauri/target/${{ matrix.target }}/release/build + Remove-Item -Recurse -Force -ErrorAction SilentlyContinue src-tauri/target/${{ matrix.target }}/release/incremental + - name: Show sccache stats run: sccache --show-stats