Skip to content

Commit 7e372b5

Browse files
claudespoorcc
authored andcommitted
fix: split clcache into restore/save steps, drop deprecated save-always
actions/cache v5.0.5 marks save-always as deprecated and "not working as intended". Replace the single cache step with a restore step before the build and a save step after, guarded by always() so it runs on build failure too. The save is skipped on an exact cache-hit to avoid redundant uploads. https://claude.ai/code/session_01XTvMZtPH8WpuiRBZkqWiHk
1 parent 7a5d365 commit 7e372b5

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ jobs:
7171
verbose: 1
7272
create-symlink: true
7373

74-
- name: Setup cache for clcache
74+
- name: Restore cache for clcache
75+
id: clcache-restore
7576
if: ${{ matrix.platform == 'windows-latest' }}
76-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
77+
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
7778
with:
7879
path: ${{ github.workspace }}\.clcache
7980
key: ${{ github.job }}-${{ matrix.platform }}-${{ github.sha }}
8081
restore-keys: |
8182
${{ github.job }}-${{ matrix.platform }}-
82-
save-always: true
8383
8484
- name: Create sbom, binary & package
8585
env:
@@ -94,6 +94,13 @@ jobs:
9494
python script/build.py
9595
python script/package.py
9696
97+
- name: Save cache for clcache
98+
if: ${{ always() && matrix.platform == 'windows-latest' && steps.clcache-restore.outputs.cache-hit != 'true' }}
99+
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
100+
with:
101+
path: ${{ github.workspace }}\.clcache
102+
key: ${{ steps.clcache-restore.outputs.cache-primary-key }}
103+
97104
- name: Store the distribution packages
98105
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
99106
with:

0 commit comments

Comments
 (0)