mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-15 12:53:31 +08:00
Carry Bun compile cache into Tauri packaging
Tauri runs the repository beforeBuildCommand during packaging, which invokes build:sidecars again after the explicit sidecar step has already passed. The Windows runner therefore still needs the same Bun compile cache override inside the packaging step so the repeated baseline runtime extraction stays on the runner work drive. Constraint: Tauri beforeBuildCommand re-enters the sidecar build under the packaging step environment. Rejected: Remove beforeBuildCommand from CI | that would diverge CI from normal Tauri packaging behavior. Confidence: high Scope-risk: narrow Directive: Keep explicit sidecar build and Tauri packaging environments in sync when changing desktop workflow target or cache settings. Tested: bun test scripts/pr/release-workflow.test.ts; bun run check:policy Not-tested: GitHub Actions Windows runner rerun after push.
This commit is contained in:
parent
1886d9c288
commit
562c1e1bee
1
.github/workflows/build-desktop-dev.yml
vendored
1
.github/workflows/build-desktop-dev.yml
vendored
@ -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 (不需要签名密钥)
|
||||
|
||||
2
.github/workflows/release-desktop.yml
vendored
2
.github/workflows/release-desktop.yml
vendored
@ -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:
|
||||
|
||||
@ -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 }}',
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user