Skip to content

Commit 8f914fd

Browse files
committed
Stop using deprecated save-always
1 parent f05d2b4 commit 8f914fd

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/build-samples-and-snippets.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,23 @@ jobs:
2525
dotnet workload install aspire
2626
- name: Add MSBuild to PATH
2727
uses: microsoft/setup-msbuild@v2
28-
- name: NuGet Cache
29-
uses: actions/cache@v4
28+
- name: Restore NuGet Cache
29+
id: nuget-cache-restore
30+
uses: actions/cache/restore@v4
3031
with:
3132
path: ~/.nuget/packages
3233
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
3334
restore-keys: |
3435
${{ runner.os }}-nuget-
35-
save-always: true
3636
- name: Build affected samples and snippets
3737
run: pwsh.exe -NoLogo -NonInteractive -File .\tools\build-samples-and-snippets.ps1
38+
- name: Save NuGet Cache
39+
id: nuget-cache-save
40+
if: always() && steps.nuget-cache-restore.outputs.cache-hit != 'true'
41+
uses: actions/cache/save@v4
42+
with:
43+
path: ~/.nuget/packages
44+
key: ${{ steps.nuget-cache-restore.outputs.cache-primary-key }}
3845
- name: Notify Slack on failure
3946
if: ${{ failure() }}
4047
shell: pwsh

0 commit comments

Comments
 (0)