forked from Tenacom/AaaLib
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (102 loc) · 3.54 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
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
checkPublicApi:
description: 'Check public API files'
required: false
default: true
type: boolean
forceUpdateChangelog:
description: 'Update changelog on preview'
required: false
default: false
type: boolean
checkChangelog:
description: 'Check changelog before update'
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'
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 MyGet feed
PRERELEASE_NUGET_SOURCE: 'https://www.myget.org/F/tenacom-preview/api/v3/index.json'
PRERELEASE_NUGET_KEY: ${{ secrets.MYGET_DEPLOYMENT_KEY }}
# Deploy all private packages on a private MyGet feed
MYGET_PRIVATE_FEED_PASSWORD: ${{ secrets.MYGET_PRIVATE_FEED_PASSWORD }}
PRIVATE_NUGET_SOURCE: 'https://www.myget.org/F/tenacom/api/v3/index.json'
PRIVATE_NUGET_KEY: ${{ secrets.MYGET_PRIVATE_FEED_KEY }}
VERSION_SPEC_CHANGE: ${{ inputs.versionSpecChange }}
CHECK_PUBLIC_API: ${{ inputs.checkPublicApi }}
FORCE_UPDATE_CHANGELOG: ${{ inputs.forceUpdateChangelog }}
CHECK_CHANGELOG: ${{ inputs.checkChangelog }}
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%
echo Update changelog on preview : %FORCE_UPDATE_CHANGELOG%
echo Check changelog before update : %CHECK_CHANGELOG%
echo Cake verbosity : %CAKE_VERBOSITY%
- name: Checkout repository with full history
uses: actions/checkout@v3
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@v3
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
uses: codecov/codecov-action@v3
with:
working-directory: ./TestResults/
files: Cobertura.xml
name: v${{ steps.build.outputs.version }}
verbose: true