-
-
Notifications
You must be signed in to change notification settings - Fork 202
72 lines (59 loc) · 1.96 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Create Release
on:
push:
tags:
- "*.*.*"
workflow_dispatch:
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Fetch all commits
run: git fetch --unshallow
- uses: gittools/actions/gitversion/[email protected]
name: Install GitVersion
with:
versionSpec: "6.x"
- uses: gittools/actions/gitversion/[email protected]
name: Execute GitVersion
id: gitversion # step id used as reference for output values
with:
updateAssemblyInfo: true
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
- name: Deploy to NuGet
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
dotnet pack -c Release /p:Version=${{ steps.gitversion.outputs.SemVer}} -o "nuget"
dotnet nuget push nuget/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
- name: Read release notes preface
id: release_preface
uses: juliangruber/read-file-action@v1
with:
path: .github/RELEASE_TEMPLATE.md
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: true
body: |
${{ steps.release_preface.outputs.content }}
${{ steps.extract-release-notes.outputs.release_notes }}