Skip to content

Commit bc8131c

Browse files
Cache WinGet CLI payload in release workflow
1 parent bfa6afa commit bc8131c

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,29 @@ jobs:
147147
$PackageVersion = '${{ needs.preflight.outputs.package-version }}'
148148
.\scripts\set-version.ps1 -Version $PackageVersion
149149
150+
- name: Restore WinGet CLI cache
151+
id: winget-cache
152+
uses: actions/cache/restore@v4
153+
with:
154+
path: src/UniGetUI.PackageEngine.Managers.WinGet/winget-cli_${{ matrix.platform }}
155+
key: winget-cli-${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('scripts/fetch-winget-cli.ps1') }}
156+
150157
- name: Fetch WinGet CLI bundle
158+
if: steps.winget-cache.outputs.cache-hit != 'true'
151159
shell: pwsh
152160
env:
153161
GITHUB_TOKEN: ${{ github.token }}
154162
run: |
155163
$Platform = '${{ matrix.platform }}'
156164
.\scripts\fetch-winget-cli.ps1 -Architectures @($Platform) -Force
157165
166+
- name: Save WinGet CLI cache
167+
if: steps.winget-cache.outputs.cache-hit != 'true'
168+
uses: actions/cache/save@v4
169+
with:
170+
path: src/UniGetUI.PackageEngine.Managers.WinGet/winget-cli_${{ matrix.platform }}
171+
key: ${{ steps.winget-cache.outputs.cache-primary-key }}
172+
158173
- name: Restore dependencies
159174
working-directory: src
160175
run: dotnet restore

0 commit comments

Comments
 (0)