-
-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (47 loc) · 1.72 KB
/
Release.yml
File metadata and controls
62 lines (47 loc) · 1.72 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Publish to Nuget.org
on:
push:
tags:
- "v*.*.*"
- "*.*.*"
permissions:
contents: write
packages: write
env:
DOTNET_NOLOGO: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Calculate version from the Commit Tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
- run: dotnet restore --verbosity minimal
- run: dotnet build --configuration Release -p:ContinuousIntegrationBuild=true -p:DebugType=Embedded -p:version=${{ env.RELEASE_VERSION }}
- run: dotnet pack --configuration Release --no-build --output ./artifacts -p:DebugType=Embedded -p:version=${{ env.RELEASE_VERSION }}
- name: Publish artifacts
uses: actions/upload-artifact@v3
with:
name: NuGetPackage.${{ env.RELEASE_VERSION }}
path: ./artifacts/
- name: Upload release assets
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: NuGetPackage.${{ env.RELEASE_VERSION }}
files: ./artifacts/*
- name: Publish to GPR
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--no-symbols \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--source https://nuget.pkg.github.com/${{ github.repository_owner }}
- name: Publish to NuGet.org
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--api-key ${{ secrets.NUGET_TOKEN }} \
--source https://api.nuget.org/v3/index.json