-
Notifications
You must be signed in to change notification settings - Fork 29
44 lines (34 loc) · 1.05 KB
/
NugetPublish.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 to nuget.org
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v3
# https://github.com/dotnet-campus/dotnetCampus.TagToVersion
- name: Install dotnet tool
run: dotnet tool install -g dotnetCampus.TagToVersion
- name: Set tag to version
run: dotnet TagToVersion -t ${{ github.ref }} -f Version.props
- name: Build
run: dotnet build -c Release
- name: Pack
run: dotnet pack -c Release -o Artifacts
- name: Upload artifacts (nupkg)
uses: actions/upload-artifact@v3
with:
name: nupkgs
path: |
Artifacts/*.nupkg
Artifacts/*.snupkg
- name: Publish to nuget.org
run: dotnet nuget push Artifacts/*.nupkg --api-key ${{ secrets.NugetKey }} --source https://api.nuget.org/v3/index.json