-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (35 loc) · 1.34 KB
/
nuget.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
name: NuGet
on:
push:
tags: [ 'v*.*.*' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: ./.github/gitversion.yml
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release -p:Version=${{ steps.gitversion.outputs.AssemblySemVer }} -p:AssemblyVersion=${{ steps.gitversion.outputs.AssemblySemVer }} -p:InformationalVersion=${{ steps.gitversion.outputs.InformationalVersion }} --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
- name: Package
run: dotnet pack --configuration Release --include-symbols -o:package -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ steps.gitversion.outputs.AssemblySemVer }}
- name: Publish
run: dotnet nuget push ./package/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }}