Skip to content

Commit 3514297

Browse files
authored
Create publish.yml
1 parent b57fee3 commit 3514297

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: publish
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
build-test-pack-publish:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: |
23+
8.0.x
24+
6.0.x
25+
26+
- name: Restore dependencies
27+
run: dotnet restore
28+
29+
- name: Build
30+
run: dotnet build --configuration Release --no-restore
31+
32+
- name: Test
33+
run: dotnet test --no-build --verbosity normal --configuration Release
34+
35+
- name: Pack
36+
run: dotnet pack --configuration Release --no-build -p:PackageVersion=${{ github.event.release.tag_name }}
37+
38+
- name: Publish to NuGet
39+
run: dotnet nuget push "**/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}

0 commit comments

Comments
 (0)