diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c0f46d..25878a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,13 +43,14 @@ jobs: - name: Setup Dotnet uses: actions/setup-dotnet@v4 with: + dotnet-version: 8.x source-url: https://nuget.pkg.github.com/ResoniteModdingGroup/index.json - name: Add MonkeyLoader NuGet Source run: dotnet nuget add source https://pkg.munally.com/MonkeyModdingTroop/index.json - - - name: Cache NuGet Packages - uses: actions/cache@v4 + + - name: Restore NuGet Package Cache + uses: actions/cache/restore@v4 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} @@ -81,6 +82,14 @@ jobs: if-no-files-found: error retention-days: 7 path: ./*.nupkg + + # Only when it's not from a PR to avoid any funny packages in the cache + - name: Save NuGet Package Cache + if: ${{ github.event_name != 'pull_request' }} + uses: actions/cache/save@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} Validate-NuGet: runs-on: ubuntu-latest @@ -89,14 +98,16 @@ jobs: - name: Setup Dotnet uses: actions/setup-dotnet@v4 with: + dotnet-version: 8.x source-url: https://nuget.pkg.github.com/ResoniteModdingGroup/index.json - name: Add MonkeyLoader NuGet Source run: dotnet nuget add source https://pkg.munally.com/MonkeyModdingTroop/index.json - - - name: Cache NuGet Packages - uses: actions/cache@v4 + + - name: Restore NuGet Package Cache + uses: actions/cache/restore@v4 with: + save-always: true path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} restore-keys: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 23c5474..059338c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -68,6 +68,7 @@ jobs: - name: Setup Dotnet uses: actions/setup-dotnet@v4 with: + dotnet-version: 8.x source-url: https://nuget.pkg.github.com/ResoniteModdingGroup/index.json - name: Add MonkeyLoader NuGet Source