-
Notifications
You must be signed in to change notification settings - Fork 86
415 lines (359 loc) · 13.2 KB
/
build_prerelease.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
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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
name: build_prerelease
on:
push:
branches:
- dev
jobs:
# bump the version and build the changelog
version_and_changelog:
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
outputs:
version: ${{ steps.push_tag.outputs.version }}
changelog: ${{ steps.github_changelog.outputs.changelog }}
steps:
# fail out if this is not a merge commit
- name: ensure merge
if: ${{ !startsWith(github.event.head_commit.message, 'Merge') }}
run: exit 1
- name: checkout version
uses: actions/[email protected]
with:
fetch-depth: 0
- name: get last merge
id: last_merge
shell: bash
run: |
echo "short_hash=$(echo $(git log --oneline --merges -n 10 | grep -m2 "pull request" | tail -n1 | cut -d' ' -f1))" >> $GITHUB_OUTPUT
- run: |
echo "Last Merge: ${{ steps.last_merge.outputs.short_hash }}"
# wait for any previous versions to be tagged and committed
- uses: lewagon/[email protected]
continue-on-error: true
with:
ref: ${{ steps.last_merge.outputs.short_hash }}
check-name: 'version_and_changelog'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
allowed-conclusions: success,skipped,cancelled,failure
# tag push
- uses: jefflinse/[email protected]
name: Bump and Tag Version
id: push_tag
with:
mode: bump
repo-token: ${{ secrets.GITHUB_TOKEN }}
minor-label: semver:feature
patch-label: semver:patch
with-v: true
# github changelog
- name: "Generate release changelog"
id: github_changelog
uses: heinrichreimer/[email protected]
with:
sinceTag: ${{ steps.push_tag.outputs.old-version }}
stripHeaders: true
verbose: false
issuesWoLabels: false
maxIssues: 300
stripGeneratorNotice: true
compareLink: false
simpleList: true
token: ${{ secrets.RELEASE_TOKEN }}
- name: Upload changelog
uses: actions/[email protected]
with:
name: changelog
path: CHANGELOG.md
plugin_build:
env:
PLUGIN_NAME: hdr
runs-on: ubuntu-20.04
needs: version_and_changelog
container:
image: wuboyth/skyline-plugin-builder:latest
steps:
# - name: setup python
# uses: actions/[email protected]
# with:
# python-version: '3.9' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: checkout version
uses: actions/[email protected]
#- name: Rust Cache
# uses: Swatinem/[email protected]
# with:
# workspaces: "plugin"
# cache-targets: true
# cache-all-crates: true
# build the project
- run: |
cd scripts && NO_RUST_NIGHTLY=1 python3 make_dist.py build version=${{ needs.version_and_changelog.outputs.version }}-prerelease name=hdr && cd ..
env:
HOME: /root
## mock upload files
#- run: |
# mkdir distributions
# echo lol > distributions/hdr-switch.zip
# echo lol > distributions/hdr-ryujinx.zip
- name: Upload version artifact
uses: actions/[email protected]
with:
name: version
path: hdr_version.txt
- name: Upload distributions artifact
uses: actions/[email protected]
with:
name: distributions
path: distributions
############## handle uploading the files to the release ##############
upload_to_release:
runs-on: ubuntu-20.04
needs: [plugin_build, version_and_changelog]
steps:
- uses: actions/[email protected]
with:
name: distributions
# upload asset
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
file: '*.zip'
prerelease: true
file_glob: true
asset_name: the_asset
release_name: ${{ needs.version_and_changelog.outputs.version }}-prerelease
tag: ${{ needs.version_and_changelog.outputs.version }}
overwrite: true
body: ${{ needs.version_and_changelog.outputs.changelog }}
# wait for any previous prereleases to complete, since we dont want to step on any
# full package uploads prior to this one.
wait_for_previous_builds:
runs-on: ubuntu-20.04
needs: upload_to_release
steps:
- name: checkout version
uses: actions/[email protected]
with:
fetch-depth: 0
- uses: ahmadnassri/action-workflow-queue@v1
with:
delay: 30000 # 30 seconds between retries
timeout: 5400000 # 1.5 hour total timeout
############## handle the creasion of the full package installation ##############
full_package:
runs-on: ubuntu-20.04
needs: [version_and_changelog, wait_for_previous_builds]
steps:
- name: checkout version
uses: actions/[email protected]
- id: romfs_version
uses: pozetroninc/github-action-get-latest-release@master
with:
token: ${{ secrets.RELEASE_TOKEN }}
repository: HDR-Development/romfs-release
- name: Download romfs
id: get_romfs
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'HDR-Development/romfs-release'
version: 'tags/${{ steps.romfs_version.outputs.release }}'
file: 'romfs.zip'
token: ${{ secrets.RELEASE_TOKEN }}
- name: make package
run: |
python3 scripts/full_package.py ${{ needs.version_and_changelog.outputs.version }} none
# get the most recent latest full release
- id: package_latest
continue-on-error: true
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: HDR-Development/HDR-PreReleases
# build the upgrade.zip and deletions.json
- name: make upgrade artifacts
if: steps.package_latest.outcome != 'failure'
run: |
python3 scripts/make_diff.py prerelease
- name: show upgrade artifacts
if: steps.package_latest.outcome != 'failure'
run: |
ls && stat * && echo && ls upgrade_artifacts && stat upgrade_artifacts/*
# upload the upgrade data to the previous release for auto updater
- name: Upload upgrade data to previous release
if: steps.package_latest.outcome != 'failure'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: upgrade_artifacts/upgrade.zip
prerelease: false
file_glob: true
asset_name: upgrade
repo_name: HDR-Development/HDR-PreReleases
tag: ${{ steps.package_latest.outputs.release }}
overwrite: true
# upload the upgrade data to the previous release for auto updater
- name: Upload upgrade deletions to previous release
if: steps.package_latest.outcome != 'failure'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: upgrade_artifacts/deletions.json
prerelease: false
file_glob: true
asset_name: deletions
repo_name: HDR-Development/HDR-PreReleases
tag: ${{ steps.package_latest.outputs.release }}
overwrite: true
- uses: actions/[email protected]
with:
name: changelog
- name: Display structure of downloaded changelog
run: ls -R && cp CHANGELOG.md artifacts
- uses: actions/[email protected]
with:
name: version
# build the lvd files
# - id: lvd_files
# uses: robinraju/[email protected]
# with:
# repository: "techyCoder81/SSBU-LVD-data-dump"
# tag: release
# fileName: "lvd_dumper.zip"
# - name: Setup dotnet
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '5.0.408'
# - name: extract lvd data
# id: lvd_extract
# shell: bash
# run: |
# . scripts/extract_lvd_data.sh
- name: Display structure of downloaded version
run: ls -R && cp hdr_version.txt artifacts
# - name: Push lvd file to Suddy's HDRStageTool
# uses: dmnemec/copy_file_to_another_repo_action@main
# env:
# API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB_HDRSTAGETOOL }}
# with:
# source_file: 'artifacts/lvd.zip'
# destination_folder: 'prerelease'
# destination_repo: 'SuddyN/HDRStageTool'
# user_email: '[email protected]'
# user_name: 'SuddyN'
# destination_branch: 'gh-pages'
- name: Upload full package to prereleases
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: artifacts/*
prerelease: false
file_glob: true
asset_name: artifacts
repo_name: HDR-Development/HDR-PreReleases
release_name: ${{ needs.version_and_changelog.outputs.version }}-prerelease
tag: ${{ needs.version_and_changelog.outputs.version }}
overwrite: true
body: ${{ needs.version_and_changelog.outputs.changelog }}
################ handle the creation of to-prerelease.zip ################
to_prerelease:
runs-on: ubuntu-20.04
needs: [full_package, version_and_changelog]
steps:
- name: checkout version
uses: actions/[email protected]
# get the prerelease
- id: latest_prerelease
uses: robinraju/[email protected]
with:
repository: "HDR-Development/HDR-PreReleases"
tag: ${{ needs.version_and_changelog.outputs.version }}
fileName: "switch-package.zip"
# move the prerelease to the artifacts dir
- run: mkdir artifacts && mv switch-package.zip artifacts
# build the to-prerelease.zip
- name: make to-prerelease.zip artifact
run: |
python3 scripts/make_diff.py beta
- name: show upgrade artifacts
run: |
ls && stat * && echo && ls upgrade_artifacts && stat upgrade_artifacts/*
- run: mv upgrade_artifacts/upgrade.zip to-prerelease.zip
- run: mv upgrade_artifacts/deletions.json to_prerelease_deletions.json
# get the most recent latest beta
- id: latest_beta
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: HDR-Development/HDR-Releases
# upload the to-prerelease.zip to the beta for the launcher
- name: Upload to-prerelease.zip to beta
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: to-prerelease.zip
prerelease: false
file_glob: false
asset_name: to-prerelease.zip
repo_name: HDR-Development/HDR-Releases
tag: ${{ steps.latest_beta.outputs.release }}
overwrite: true
# upload the to_prerelease_deletions.json to the beta for the launcher
- name: Upload to_prerelease_deletions.json to beta
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: to_prerelease_deletions.json
prerelease: false
file_glob: false
asset_name: to_prerelease_deletions.json
repo_name: HDR-Development/HDR-Releases
tag: ${{ steps.latest_beta.outputs.release }}
overwrite: true
################ handle the creation of to-beta.zip ################
to_beta:
runs-on: ubuntu-20.04
needs: [full_package, version_and_changelog]
steps:
- name: checkout version
uses: actions/[email protected]
# get the beta
- id: latest_beta
uses: robinraju/[email protected]
with:
repository: "HDR-Development/HDR-Releases"
latest: true
fileName: "switch-package.zip"
# move the beta to the artifacts dir
- run: mkdir artifacts && mv switch-package.zip artifacts
# build the to-beta.zip
- name: make to-beta.zip artifact
run: |
python3 scripts/make_diff.py https://github.com/HDR-Development/HDR-PreReleases/releases/download/${{ needs.version_and_changelog.outputs.version }}/switch-package.zip
- name: show upgrade artifacts
run: |
ls && stat * && echo && ls upgrade_artifacts && stat upgrade_artifacts/*
- run: mv upgrade_artifacts/upgrade.zip to-beta.zip
- run: mv upgrade_artifacts/deletions.json to_beta_deletions.json
# upload the to-beta.zip to the beta for the launcher
- name: Upload to-beta.zip to prerelease
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: to-beta.zip
prerelease: false
file_glob: false
asset_name: to-beta.zip
repo_name: HDR-Development/HDR-PreReleases
tag: ${{ needs.version_and_changelog.outputs.version }}
overwrite: true
# upload the to_beta_deletions.json to the beta for the launcher
- name: Upload to_beta_deletions.json to prerelease
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: to_beta_deletions.json
prerelease: false
file_glob: false
asset_name: to_beta_deletions.json
repo_name: HDR-Development/HDR-PreReleases
tag: ${{ needs.version_and_changelog.outputs.version }}
overwrite: true