Skip to content

Commit

Permalink
Create NuGet release action
Browse files Browse the repository at this point in the history
  • Loading branch information
derekmckinnon committed Jan 29, 2023
1 parent c03f43c commit 6d5908a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish to NuGet

on:
release:
types: [ published ]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-dotnet@v3
with:
global-json-file: ./global.json

- run: dotnet restore
- run: dotnet build --no-restore

- run: |
dotnet pack src/CatConsult.EnvConfigurationProvider \
-p:PackageVersion="$GITHUB_REF_NAME" \
--no-build \
--output "$RUNNER_TEMP/output"
- env:
API_KEY: ${{ secrets.CATCONSULT_NUGET_API_KEY }}
run: |
dotnet nuget push "$RUNNER_TEMP/output/*.nupkg" \
--source https://api.nuget.org/v3/index.json \
--api-key "$API_KEY"

0 comments on commit 6d5908a

Please sign in to comment.