Skip to content

Commit 72da3ad

Browse files
committed
Package config
1 parent 2315dae commit 72da3ad

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/package.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish NuGet package
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
packages: write
12+
contents: read
13+
steps:
14+
- uses: actions/checkout@v5
15+
- uses: actions/setup-dotnet@v4
16+
with:
17+
dotnet-version: 8.0.x
18+
19+
- name: Build release
20+
run: dotnet build src/Devlord.Utilities/Devlord.Utilities.csproj --configuration Release
21+
- name: Pack prerelease with build number
22+
if: "github.event.release.prerelease"
23+
run: |
24+
dotnet pack --configuration Release --output ./nupkg \
25+
-p:VersionSuffix="preview.${{ github.run_number }}"
26+
- name: Pack release
27+
if: "!github.event.release.prerelease"
28+
run: dotnet pack --configuration Release --output ./nupkg
29+
- name: Publish packages to NuGet
30+
run: dotnet nuget push "./nupkg/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)