-
Notifications
You must be signed in to change notification settings - Fork 3
126 lines (119 loc) · 4.38 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Publish a release
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
versionSpecChange:
description: 'Version spec change'
required: true
type: choice
default: 'None'
options:
- None
- Unstable
- Stable
- Minor
- Major
checkPublicApiFiles:
description: 'Check public API files'
required: false
default: true
type: boolean
updateChangelogOnPrerelease:
description: 'Update changelog on prerelease'
required: false
default: false
type: boolean
ensureChangelogNotEmpty:
description: 'Ensure changelog not empty'
required: false
default: true
type: boolean
cakeVerbosity:
description: 'Cake verbosity'
required: true
type: choice
default: 'Normal'
options:
- Normal
- Verbose
- Diagnostic
jobs:
release:
runs-on: windows-latest
env:
DOTNET_NOLOGO: 'true'
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true'
DOTNET_CLI_UI_LANGUAGE: 'en-US'
FEEDZ_IO_PRIVATE_TOKEN: ${{ secrets.FEEDZ_IO_PRIVATE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# Deploy non-prerelease public packages on NuGet
RELEASE_NUGET_SOURCE: 'https://api.nuget.org/v3/index.json'
RELEASE_NUGET_KEY: ${{ secrets.NUGET_DEPLOYMENT_KEY }}
# Deploy prerelease public packages on a public Feedz.io feed
PRERELEASE_NUGET_SOURCE: 'https://f.feedz.io/tenacom/preview/nuget/index.json'
PRERELEASE_NUGET_KEY: ${{ secrets.FEEDZ_IO_PRIVATE_TOKEN }}
# Deploy all private packages on a private Feedz.io feed
PRIVATE_NUGET_SOURCE: 'https://f.feedz.io/tenacom/private/nuget/index.json'
PRIVATE_NUGET_KEY: ${{ secrets.FEEDZ_IO_PRIVATE_TOKEN }}
VERSION_SPEC_CHANGE: ${{ inputs.versionSpecChange }}
CHECK_PUBLIC_API_FILES: ${{ inputs.checkPublicApiFiles }}
UPDATE_CHANGELOG_ON_PRERELEASE: ${{ inputs.updateChangelogOnPrerelease }}
ENSURE_CHANGELOG_NOT_EMPTY: ${{ inputs.ensureChangelogNotEmpty }}
CAKE_VERBOSITY: ${{ inputs.cakeVerbosity }}
steps:
- name: Log workflow inputs
shell: cmd
run: |
echo Version spec change : %VERSION_SPEC_CHANGE%
echo Check public API files : %CHECK_PUBLIC_API_FILES%
echo Update changelog on prerelease : %UPDATE_CHANGELOG_ON_PRERELEASE%
echo Ensure changelog not empty : %ENSURE_CHANGELOG_NOT_EMPTY%
echo Cake verbosity : %CAKE_VERBOSITY%
- name: Checkout repository with full history
uses: actions/checkout@v4
with:
fetch-depth: 0 # Checkout with full history so nbgv can compute Git height correctly.
token: ${{ secrets.RELEASE_TOKEN }}
persist-credentials: true # We need auth set up in the Cake script
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore .NET tools
shell: cmd
run: dotnet tool restore
- name: Run build script
id: build
shell: cmd
run: |
if [%CAKE_VERBOSITY%]==[] set CAKE_VERBOSITY=Normal
if [%RUNNER_DEBUG%]==[1] set CAKE_VERBOSITY=Diagnostic
dotnet cake --target Release --verbosity %CAKE_VERBOSITY%
- name: Upload coverage to Codecov
if: hashFiles('temp/Cobertura.xml') != ''
uses: codecov/codecov-action@v4
with:
working-directory: ./temp/
files: Cobertura.xml
name: v${{ steps.build.outputs.version }}
verbose: true
# Publish DocFX-generated documentation on GitHub pages.
# If there is no index.html file in docs/site, steps.setupGitHubPages.conclusion will be 'skipped';
# this will cause subsequent steps to be skipped too.
- name: Setup GitHub Pages
id: setupGitHubPages
if: hashFiles('docs/_site/index.html') != ''
uses: actions/configure-pages@v4
- name: Upload documentation artifact
id: uploadDocsArtifact
if: steps.setupGitHubPages.conclusion == 'success'
uses: actions/upload-pages-artifact@v3
with:
path: docs/_site/
- name: Deploy documentation to GitHub Pages
if: steps.uploadDocsArtifact.conclusion == 'success'
uses: actions/deploy-pages@v4