From 0ff4d85310869f4a6ed77278e6e012c36cdbb691 Mon Sep 17 00:00:00 2001 From: Michael Mell Date: Tue, 14 Jan 2025 15:44:00 +0100 Subject: [PATCH] Cache NuGet packages. --- .github/workflows/release-build.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 797f971..c948f8b 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -26,6 +26,9 @@ jobs: # this is the last Github runner VM that supports .Net Framework 2019 runs-on: windows-2019 + env: + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages + steps: - name: Checkout code base uses: actions/checkout@v4.1.1 @@ -39,6 +42,16 @@ jobs: - name: Setup NuGet.exe for use with actions uses: NuGet/setup-nuget@v2.0.0 + # Cache NuGet packages to speed up build. Hash is based on project files. + # Note the appending of 0 to the key: You can modify this value to + # invalidate the cache. + - uses: actions/cache@v4 + with: + path: ${{ github.workspace }}\.nuget\packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget-0 + - name: Restore NuGet packages run: nuget restore AutoTx.sln