-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (38 loc) · 1.21 KB
/
nuget-tag-publish.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
45
46
47
48
49
50
name: publish nuget
on:
push:
tags:
- '*'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install dotnet tool
run: dotnet tool install -g dotnetCampus.TagToVersion
- name: Set tag to version
run: dotnet TagToVersion -t ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
8.0.x
9.0.x
- name: Build with dotnet
run: |
dotnet build --configuration Release
dotnet pack --configuration Release --no-build
- name: Install Nuget
uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- name: Add private GitHub registry to NuGet
run: |
nuget sources add -name github -Source https://nuget.pkg.github.com/dotnet-campus/index.json -Username dotnet-campus -Password ${{ secrets.GITHUB_TOKEN }}
- name: Push generated package to GitHub registry
run: |
nuget push .\bin\Release\*.nupkg -Source github -SkipDuplicate
nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}