-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (78 loc) · 2.14 KB
/
release.yaml
File metadata and controls
88 lines (78 loc) · 2.14 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (1.0.0)'
required: true
type: string
publish:
description: 'Publish type'
required: true
type: choice
options:
- none
- release
- publish
jobs:
# Calls the reusable build workflow to build, test, and generate documentation
# for the release version.
build:
name: Build
permissions:
actions: read
contents: read
pull-requests: write
security-events: write
uses: ./.github/workflows/build.yaml
with:
version: ${{ inputs.version }}
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Cuts and publishes the release, creating a GitHub release with artifacts
# and optionally publishing the NuGet package.
release:
name: Release
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.x
9.x
10.x
- name: Download package artifacts
uses: actions/download-artifact@v8
with:
name: packages-ubuntu-latest
path: artifacts
- name: Download documents artifact
uses: actions/download-artifact@v8
with:
name: documents
path: artifacts
- name: Move buildnotes.md to root
run: |
set -e
mv artifacts/buildnotes.md buildnotes.md
- name: Create GitHub Release
if: inputs.publish == 'release' || inputs.publish == 'publish'
uses: ncipollo/release-action@v1
with:
tag: ${{ inputs.version }}
artifacts: artifacts/*
bodyFile: buildnotes.md
generateReleaseNotes: false
- name: Publish to NuGet.org
if: inputs.publish == 'publish'
run: |
set -e
dotnet nuget push artifacts/*.nupkg \
--api-key ${{ secrets.DEMACONSULTINGNUGETKEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate