Skip to content

Commit fe96a9f

Browse files
committed
add workflow to publish nuget package
1 parent 538d982 commit fe96a9f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/nuget-publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: nuget publish
2+
3+
on:
4+
release:
5+
types: # This configuration does not affect the page_build event above
6+
- created
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: GitHub Environment Variables Action
17+
uses: FranzDiebold/github-env-vars-action@v2
18+
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v1
21+
with:
22+
dotnet-version: 5.0.x
23+
24+
- name: dotnet restore
25+
run: dotnet restore
26+
27+
- name: dotnet build
28+
run: dotnet build --no-restore -c Release
29+
30+
- name: dotnet test
31+
run: dotnet test --no-build -c Release
32+
33+
- name: dotnet pack
34+
run: dotnet pack --no-build -c Release --include-source --include-symbols -p:PackageVersion='${{ env.CI_REF_NAME }}' -p:SymbolPackageFormat=snupkg
35+
36+
- name: dotnet nuget push
37+
run: dotnet nuget push **/*.nupkg --api-key ${{secrets.NUGET_ORG_API_KEY}} --source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)