diff --git a/.github/workflows/build-desktop-dev.yml b/.github/workflows/build-desktop-dev.yml index e973700b..aaad88c0 100644 --- a/.github/workflows/build-desktop-dev.yml +++ b/.github/workflows/build-desktop-dev.yml @@ -134,6 +134,7 @@ jobs: - name: Build Tauri app working-directory: desktop env: + BUN_INSTALL_CACHE_DIR: ${{ runner.temp }}/bun-install-cache TAURI_ENV_TARGET_TRIPLE: ${{ matrix.rust_target }} run: | # 开发构建: 禁用 updater artifacts (不需要签名密钥) diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index e10b1ef2..8eb5481d 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -166,7 +166,9 @@ jobs: - name: Build Tauri app uses: tauri-apps/tauri-action@v0 env: + BUN_INSTALL_CACHE_DIR: ${{ runner.temp }}/bun-install-cache GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAURI_ENV_TARGET_TRIPLE: ${{ matrix.rust_target }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} with: diff --git a/scripts/pr/release-workflow.test.ts b/scripts/pr/release-workflow.test.ts index b1a0c0d6..bef3d1b5 100644 --- a/scripts/pr/release-workflow.test.ts +++ b/scripts/pr/release-workflow.test.ts @@ -17,16 +17,18 @@ describe('release desktop workflow', () => { '.github/workflows/release-desktop.yml', ]) { const workflow = readFileSync(workflowPath, 'utf8') - const buildSidecarsStep = workflow.match( - /- name: Build sidecars[\s\S]*?run: bun run build:sidecars/, - )?.[0] + for (const stepName of ['Build sidecars', 'Build Tauri app']) { + const step = workflow.match( + new RegExp(`- name: ${stepName}[\\s\\S]*?(?:\\n\\s{6}- name:|\\n\\s*# ──|\\n\\s*with:|$)`), + )?.[0] - expect(buildSidecarsStep, workflowPath).toContain( - 'BUN_INSTALL_CACHE_DIR: ${{ runner.temp }}/bun-install-cache', - ) - expect(buildSidecarsStep, workflowPath).toContain( - 'TAURI_ENV_TARGET_TRIPLE: ${{ matrix.rust_target }}', - ) + expect(step, `${workflowPath} ${stepName}`).toContain( + 'BUN_INSTALL_CACHE_DIR: ${{ runner.temp }}/bun-install-cache', + ) + expect(step, `${workflowPath} ${stepName}`).toContain( + 'TAURI_ENV_TARGET_TRIPLE: ${{ matrix.rust_target }}', + ) + } } }) })