-
-
Notifications
You must be signed in to change notification settings - Fork 5
195 lines (166 loc) · 7.83 KB
/
Copy pathrelease.yml
File metadata and controls
195 lines (166 loc) · 7.83 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: 🚀 Release
run-name: ${{ vars.PROJECT_NAME }} ${{ inputs.release-type }} Release ${{ inputs.dry-run == true && '(Dry Run)' || '' }}
defaults:
run:
shell: pwsh
permissions:
contents: write # for creating releases
issues: read # for milestone checks
pull-requests: write
id-token: write
env:
CS_PROJ_FILE_NAME: ${{ github.workspace }}/${{ vars.PROJECT_NAME }}/${{ vars.PROJECT_NAME }}.csproj
on:
workflow_dispatch:
inputs:
release-type:
description: The type of release. Choose 'Preview' or 'Production'.
required: true
type: choice
options: [Preview, Production]
dry-run:
description: Dry Run - Check to run the workflow without creating a release.
required: false
default: false
type: boolean
jobs:
get_and_validate_version:
name: Get And Validate Version
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Get Version
id: get-version
uses: KinsonDigital/Infrastructure/actions/get-version@acc7aa3997697717943e56c439f7b529d1e1d1ba # v19.0.0
with:
version-file-path: "${{ github.workspace }}/${{ vars.PROJECT_NAME }}/${{ vars.PROJECT_NAME }}.csproj"
cache-enabled: false
- name: Validate Version
id: validate-version
uses: KinsonDigital/Infrastructure/actions/validate-version@acc7aa3997697717943e56c439f7b529d1e1d1ba # v19.0.0
with:
version: "${{ steps.get-version.outputs.version }}"
release-type: "${{ inputs.release-type }}"
cache-enabled: false
validate_release:
name: Validate Release
needs: [get_and_validate_version]
uses: KinsonDigital/Infrastructure/.github/workflows/validate-release.yml@acc7aa3997697717943e56c439f7b529d1e1d1ba # v19.0.0
with:
owner-name: ${{ vars.ORGANIZATION_NAME }}
repo-name: ${{ vars.PROJECT_NAME }}
release-type: ${{ inputs.release-type }}
version: ${{ needs.get_and_validate_version.outputs.version }}
relative-release-notes-file-path: "ReleaseNotes/${{ inputs.release-type }}Releases/${{ vars.RELEASE_NOTES_FILE_NAME_PREFIX }}${{ needs.get_and_validate_version.outputs.version }}.md"
is-dotnet-project: true
secrets:
cicd-pat: ${{ secrets.CICD_TOKEN }}
build_casl:
name: Build CASL Status Check
needs: [validate_release]
strategy:
fail-fast: false
matrix:
platform: [windows-2025, ubuntu-22.04, macos-26]
build_config: [Debug, Release]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set Up .NET SDK (${{ vars.NET_SDK_VERSION }})
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: ${{ vars.NET_SDK_VERSION }}
- name: Run Build
env:
WORKSPACE: ${{ github.workspace }}
PROJECT_NAME: ${{ vars.PROJECT_NAME }}
BUILD_CONFIG: ${{ matrix.build_config }}
run: dotnet build "$($env:WORKSPACE)/$($env:PROJECT_NAME)/$($env:PROJECT_NAME).csproj" -c "$env:BUILD_CONFIG";
run_casl_tests:
name: Run CASL Tests
needs: [validate_release]
strategy:
fail-fast: false
matrix:
platform: [windows-2025, ubuntu-22.04, macos-26]
build_config: [Debug, Release]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set Up .NET SDK (${{ vars.NET_SDK_VERSION }})
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: ${{ vars.NET_SDK_VERSION }}
- name: Run Tests
env:
WORKSPACE: ${{ github.workspace }}
PROJECT_NAME: ${{ vars.PROJECT_NAME }}
BUILD_CONFIG: ${{ matrix.build_config }}
run: dotnet test "$($env:WORKSPACE)/Testing/$($env:PROJECT_NAME)Testing/$($env:PROJECT_NAME)Testing.csproj" -c "$env:BUILD_CONFIG";
run_release:
name: Performing ${{ inputs.release-type }} Release of ${{ vars.PROJECT_NAME }} ${{ inputs.dry-run == true && '(Dry Run)' || '' }}
needs: [build_casl, run_casl_tests, get_and_validate_version]
uses: KinsonDigital/Infrastructure/.github/workflows/dotnet-lib-release.yml@acc7aa3997697717943e56c439f7b529d1e1d1ba # v19.0.0
with:
owner-name: "${{ vars.ORGANIZATION_NAME }}"
repo-name: "${{ vars.PROJECT_NAME }}"
project-name: "${{ vars.PROJECT_NAME }}"
release-type: "${{ inputs.release-type }}"
net-sdk-version: "${{ vars.NET_SDK_VERSION }}"
build-config: ${{ inputs.release-type == 'Production' && 'Release' || 'Debug' }}
version: ${{ needs.get_and_validate_version.outputs.version }}
transpile-readme: true
dry-run: ${{ inputs.dry-run }}
relative-release-notes-file-path: "ReleaseNotes/${{ inputs.release-type }}Releases/${{ vars.RELEASE_NOTES_FILE_NAME_PREFIX }}${{ needs.get_and_validate_version.outputs.version }}.md"
secrets:
cicd-pat: "${{ secrets.CICD_TOKEN }}"
nuget-api-key: "${{ secrets.NUGET_ORG_API_KEY }}"
send_release_announcements:
name: Send Release Announcements ${{ inputs.dry-run == true && '(Dry Run)' || '' }}
runs-on: ubuntu-24.04
needs: [get_and_validate_version, validate_release, build_casl, run_casl_tests, run_release]
if: ${{ inputs.dry-run == false }}
steps:
- name: Checkout Repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Send X Release Announcement
uses: KinsonDigital/Infrastructure/actions/send-x-release-announcement@acc7aa3997697717943e56c439f7b529d1e1d1ba # v19.0.0
with:
repo-owner: ${{ vars.ORGANIZATION_NAME }}
project-name: ${{ vars.PROJECT_NAME }}
version: ${{ needs.get_and_validate_version.outputs.version }}
local-post-template-file-path: "${{ github.workspace }}/templates/${{ vars.RELEASE_POST_TEMPLATE_FILE_NAME }}"
discord-invite-code: ${{ vars.DISCORD_INVITE_CODE }}
website-url: ${{ vars.WEBSITE_URL }}
access-token-key: ${{ secrets.X_ACCESS_TOKEN_KEY }}
access-token-secret: ${{ secrets.X_ACCESS_TOKEN_SECRET }}
consumer-api-key: ${{ secrets.X_CONSUMER_API_KEY }}
consumer-api-secret: ${{ secrets.X_CONSUMER_API_SECRET }}
cache-enabled: false
github-token: ${{ secrets.CICD_TOKEN }}
- name: Send Bluesky Release Announcement
uses: KinsonDigital/Infrastructure/actions/send-bluesky-release-announcement@acc7aa3997697717943e56c439f7b529d1e1d1ba # v19.0.0
with:
repo-owner: ${{ vars.ORGANIZATION_NAME }}
project-name: ${{ vars.PROJECT_NAME }}
version: ${{ needs.get_and_validate_version.outputs.version }}
website-url: ${{ vars.WEBSITE_URL }}
local-post-template-file-path: "${{ github.workspace }}/templates/${{ vars.RELEASE_POST_TEMPLATE_FILE_NAME }}"
discord-invite-code: ${{ vars.DISCORD_INVITE_CODE }}
service: ${{ vars.BLUESKY_SERVICE }}
identifier: ${{ secrets.BLUESKY_IDENTIFIER }}
password: ${{ secrets.BLUESKY_APP_PASSWORD }}
cache-enabled: false
github-token: ${{ secrets.CICD_TOKEN }}
process_milestone:
name: Process Milestone ${{ inputs.dry-run == true && '(Dry Run)' || '' }}
needs: [get_and_validate_version, validate_release, build_casl, run_casl_tests, run_release]
if: ${{ inputs.dry-run == false }}
uses: KinsonDigital/Infrastructure/.github/workflows/process-milestone.yml@acc7aa3997697717943e56c439f7b529d1e1d1ba # v19.0.0
with:
owner-name: ${{ vars.ORGANIZATION_NAME }}
repo-name: ${{ vars.PROJECT_NAME }}
version: ${{ needs.get_and_validate_version.outputs.version }}
secrets:
cicd-pat: ${{ secrets.CICD_TOKEN }}