-
Notifications
You must be signed in to change notification settings - Fork 3
329 lines (276 loc) · 10.5 KB
/
publish_release_builds.yaml
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
name: Run Tests & Publish
on:
release:
types: [created]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
env:
dotNetVersion: net6.0
dotNetConfiguration: Release
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup Dotnet for use with actions
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.422'
- name: Cache Nuget Packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Run automated unit and integration tests
run: dotnet test
publish-osx:
needs: test
name: Publish for MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup Dotnet for use with actions
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.100
6.0.416
- name: Cache Nuget Packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: macOS-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
macOS-nuget
- name: Set up npm
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install electronize
run: dotnet tool restore
- name: Install npm dependencies
working-directory: ./AuthoringTool
run: npm install
- name: Run Tailwind build
working-directory: ./AuthoringTool
run: npm run tailwind-build
- name: Build AuthoringTool binary
working-directory: ./AuthoringTool
run: dotnet electronize build /target osx
- name: Save Build folder
uses: actions/upload-artifact@v4
with:
name: authoringtool-osx
path: ./AuthoringTool/bin/Desktop_Publish/
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: AuthoringTool/bin/Desktop_Publish/AuthoringTool-${{ github.ref_name }}.dmg
asset_name: AuthoringTool-${{ github.ref_name }}.dmg
tag: ${{ github.ref }}
publish-windows:
needs: test
name: Publish for Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
# install dependencies, build, and test
- name: Setup Dotnet for use with actions
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.100'
- name: Cache Nuget Packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: Windows-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
Windows-nuget
- name: Set up npm
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install electronize
run: dotnet tool restore
- name: Install npm dependencies
working-directory: ./AuthoringTool
run: npm install
- name: Run Tailwind build
working-directory: ./AuthoringTool
run: npm run tailwind-build
- name: Build AuthoringTool binary
working-directory: ./AuthoringTool
run: dotnet electronize build /target win
- name: Save Build folder
uses: actions/upload-artifact@v4
with:
name: authoringtool-win
path: ./AuthoringTool/bin/Desktop_Publish/
- name: Pack windows-unpacked into zip
uses: vimtor/action-zip@v1
with:
files: ./AuthoringTool/bin/Desktop_Publish/win-unpacked
dest: ./AuthoringTool/bin/Desktop_Publish/${{ github.ref_name }}-win-unpacked.zip
- name: Upload Windows installer to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'AuthoringTool\\bin\\Desktop_Publish\\AuthoringTool Setup ${{ github.ref_name }}.exe'
asset_name: AuthoringTool-${{ github.ref_name }}-Windows-Setup.exe
tag: ${{ github.ref }}
- name: Upload win-unpacked zip to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: AuthoringTool/bin/Desktop_Publish/${{ github.ref_name }}-win-unpacked.zip
asset_name: AuthoringTool-${{ github.ref_name }}-win-unpacked.zip
tag: ${{ github.ref }}
publish-linux:
needs: test
name: Publish for Linux
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup Dotnet for use with actions
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.100'
- name: Cache Nuget Packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: Linux-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
Linux-nuget
- name: Set up npm
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install electronize
run: dotnet tool restore
- name: Install npm dependencies
working-directory: ./AuthoringTool
run: npm install
- name: Run Tailwind build
working-directory: ./AuthoringTool
run: npm run tailwind-build
- name: Build AuthoringTool binary
working-directory: ./AuthoringTool
run: dotnet electronize build /target linux
- name: Save Build folder
uses: actions/upload-artifact@v4
with:
name: authoringtool-linux
path: ./AuthoringTool/bin/Desktop_Publish/
- name: Pack linux-unpacked into gzipped tarball
working-directory: ./AuthoringTool/bin/Desktop_Publish
run: tar -cavf ${{ github.ref_name }}-linux-unpacked.tar.gz ./linux-unpacked
- name: Upload linux snap to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: AuthoringTool/bin/Desktop_Publish/authoring-tool_${{ github.ref_name }}_amd64.snap
asset_name: AuthoringTool-${{ github.ref_name }}_amd64.snap
tag: ${{ github.ref }}
- name: Upload linux appimage to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: AuthoringTool/bin/Desktop_Publish/AuthoringTool-${{ github.ref_name }}.AppImage
asset_name: AuthoringTool-${{ github.ref_name }}.AppImage
tag: ${{ github.ref }}
- name: Upload linux-unpacked tar to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: AuthoringTool/bin/Desktop_Publish/${{ github.ref_name }}-linux-unpacked.tar.gz
asset_name: AuthoringTool-${{ github.ref_name }}-linux-unpacked.tar.gz
tag: ${{ github.ref }}
publish-linux-arm64:
needs: test
name: Publish for Linux ARM64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
- name: Setup Dotnet for use with actions
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.100'
- name: Cache Nuget Packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: Linux-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
Linux-nuget
- name: Set up npm
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install electronize
run: dotnet tool restore
- name: Install npm dependencies
working-directory: ./AuthoringTool
run: npm install
- name: Run Tailwind build
working-directory: ./AuthoringTool
run: npm run tailwind-build
- name: Build AuthoringTool binary
working-directory: ./AuthoringTool
run: dotnet electronize build /target custom "linux-arm64;linux" /electron-arch arm64
- name: Save Build folder
uses: actions/upload-artifact@v4
with:
name: authoringtool-linux-arm64
path: ./AuthoringTool/bin/Desktop_Publish/
- name: Pack linux-unpacked into gzipped tarball
working-directory: ./AuthoringTool/bin/Desktop_Publish
run: tar -cavf ${{ github.ref_name }}-linux-arm64-unpacked.tar.gz ./linux-arm64-unpacked
- name: Upload linux appimage to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: AuthoringTool/bin/Desktop_Publish/AuthoringTool-${{ github.ref_name }}-arm64.AppImage
asset_name: AuthoringTool-${{ github.ref_name }}-arm64.AppImage
tag: ${{ github.ref }}
- name: Upload linux-unpacked tar to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: AuthoringTool/bin/Desktop_Publish/${{ github.ref_name }}-linux-arm64-unpacked.tar.gz
asset_name: AuthoringTool-${{ github.ref_name }}-linux-arm64-unpacked.tar.gz
tag: ${{ github.ref }}
discord-notification:
needs: [test, publish-osx, publish-windows, publish-linux, publish-linux-arm64]
runs-on: ubuntu-22.04
steps:
- name: Prepare release body (description)
id: prep_body
run: |
echo "${{ github.event.release.body }}" > changes.md
- name: Discord notification
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.DISCORD_RELEASE_CHANNEL_WEBHOOK_ID }}
webhook_token: ${{ secrets.DISCORD_RELEASE_CHANNEL_WEBHOOK_TOKEN }}
username: GitHub Releases
message: "New release of **${{ github.repository }}**\nVersion: ${{ github.ref_name }} (${{github.event.release.name}})\n<${{ github.event.release.html_url }}>"
file: changes.md