-
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.41 KB
/
publish_release.yml
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: "Publish Release"
on:
release:
types: ["published"]
jobs:
publish_release:
runs-on: ubuntu-latest
if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Setup .NET"
uses: "actions/setup-dotnet@v4"
with:
dotnet-version: |
7.0.x
8.0.x
- name: Build
run: dotnet build -c Release
- name: Test
run: dotnet test --no-build -c Release
- name: "Build Nuget Packages"
run: |
mkdir build
dotnet pack --include-symbols -p:Version='${{ github.event.release.tag_name }}' -p:SymbolPackageFormat=snupkg -c Release -o build
- name: "Publish Nuget Packages"
run: "dotnet nuget push \"build/*\" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json"
- name: "Upload Nuget Packages To Github Release"
uses: "ncipollo/[email protected]"
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "build/*"
token: ${{ secrets.REPO_GITHUB_TOKEN }}
tag: ${{ github.event.release.tag_name }}
omitBodyDuringUpdate: true # We don't want to update the body of the release.
omitNameDuringUpdate: true # We don't want to update the name of the release.