-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.4 KB
/
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
45
46
47
48
49
50
51
name: Release
on:
push:
branches:
- develop
tags:
- v*
jobs:
build:
name: Build, run tests and package artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.2
with:
versionSpec: '5.2.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9.2
- name: Build
run: dotnet build -c Release
- name: Test
run: dotnet test -c Release --no-build
- name: Package
run: dotnet pack -c Release -o ./packages -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }} --no-build
- name: Store nuget package as artifact
uses: actions/upload-artifact@v2
with:
name: packages
path: ./packages/*.nupkg
deploy:
name: Deploy to Nuget
needs: build
runs-on: ubuntu-latest
steps:
- name: Download package from build
uses: actions/download-artifact@v2
with:
name: packages
- name: Push to Nuget
run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_KEY }}