-
Notifications
You must be signed in to change notification settings - Fork 2
30 lines (27 loc) · 940 Bytes
/
package.yml
File metadata and controls
30 lines (27 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Publish NuGet package
on:
release:
types: [ created ]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build release
run: dotnet build --configuration Release
- name: Pack prerelease with build number
if: "github.event.release.prerelease"
run: |
dotnet pack --configuration Release --output ./nupkg \
-p:VersionSuffix="preview.${{ github.run_number }}"
- name: Pack release
if: "!github.event.release.prerelease"
run: dotnet pack --configuration Release --output ./nupkg
- name: Publish packages to NuGet
run: dotnet nuget push "./nupkg/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json