Skip to content

Commit 4d23675

Browse files
committed
fix(ci): skip NAPI cache in release workflow
The hashFiles() function evaluates at job preparation time before Cargo.toml is modified, causing cache to always hit in releases. Add skip-cache parameter to build-upstream action to force fresh builds.
1 parent 6467968 commit 4d23675

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.github/actions/build-upstream/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ inputs:
44
target:
55
description: 'The target platform'
66
required: true
7+
skip-cache:
8+
description: 'Skip NAPI binding cache (for release builds)'
9+
required: false
10+
default: 'false'
711

812
runs:
913
using: 'composite'
@@ -25,6 +29,7 @@ runs:
2529
# Cache only NAPI bindings (the slow part, especially on Windows)
2630
- name: Restore NAPI binding cache
2731
id: cache-restore
32+
if: inputs.skip-cache != 'true'
2833
uses: actions/cache/restore@94b89442628ad1d101e352b7ee38f30e1bef108e # v5
2934
with:
3035
path: |
@@ -80,7 +85,7 @@ runs:
8085
DEBUG: napi:*
8186

8287
- name: Save NAPI binding cache
83-
if: steps.cache-restore.outputs.cache-hit != 'true'
88+
if: inputs.skip-cache != 'true' && steps.cache-restore.outputs.cache-hit != 'true'
8489
uses: actions/cache/save@94b89442628ad1d101e352b7ee38f30e1bef108e # v5
8590
with:
8691
path: |

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
uses: ./.github/actions/build-upstream
6262
with:
6363
target: ${{ matrix.settings.target }}
64+
skip-cache: 'true'
6465

6566
- name: Upload Vite+ native artifact
6667
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

0 commit comments

Comments
 (0)