Skip to content

Commit

Permalink
chore: Cache NuGet packages in GithubActions
Browse files Browse the repository at this point in the history
  • Loading branch information
rvost committed Mar 28, 2023
1 parent 1fcb2ee commit a8aec47
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

env:
PROJECT_PATH: PboSpy.sln
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/nuget-packages

jobs:
release:
Expand All @@ -21,9 +22,17 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: NuGet cache
uses: actions/cache@v3
with:
path: ${{ env.NUGET_PACKAGES }}
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore ${{ env.PROJECT_PATH }} --packages packages
run: dotnet restore ${{ env.PROJECT_PATH }}

- name: Build
run: >
Expand All @@ -33,13 +42,13 @@ jobs:
continue-on-error: true
shell: pwsh
run: |
packages\clowd.squirrel\2.9.42\tools\Squirrel.exe github-down `
${{ env.NUGET_PACKAGES }}\clowd.squirrel\2.9.42\tools\Squirrel.exe github-down `
--repoUrl "https://github.com/rvost/PboSpy"
- name: Publish
shell: pwsh
run: |
packages\clowd.squirrel\2.9.42\tools\Squirrel.exe pack `
${{ env.NUGET_PACKAGES }}\clowd.squirrel\2.9.42\tools\Squirrel.exe pack `
--framework net6 `
--packId "PboSpy" `
--packVersion "${{github.ref_name}}" `
Expand Down

0 comments on commit a8aec47

Please sign in to comment.