-
Notifications
You must be signed in to change notification settings - Fork 90
343 lines (295 loc) · 10.5 KB
/
build_beta.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
name: make beta
on:
workflow_dispatch:
inputs:
romfs_version:
type: string
description: 'The romfs version tag to use'
required: true
default: 'latest'
jobs:
version_and_changelog:
runs-on: ubuntu-24.04
if: startsWith(github.ref, 'refs/tags')
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
outputs:
changelog: ${{ steps.github_changelog.outputs.changelog }}
steps:
- name: echo ref
run: echo "ref is ${{ github.ref }}"
- name: get_last_beta
id: get_last_beta
uses: cardinalby/git-get-release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
releaseNameRegEx: beta
searchLimit: 250
- id: echo_release_info
shell: bash
run: |
echo ${{ steps.get_last_beta.outputs.tag_name }}
- name: checkout version
uses: actions/checkout@v4.1.4
with:
fetch-depth: 0
# github changelog
- name: "Generate release changelog"
id: github_changelog
uses: heinrichreimer/github-changelog-generator-action@v2.4
with:
sinceTag: ${{ steps.get_last_beta.outputs.tag_name }}
token: ${{ secrets.GITHUB_TOKEN }}
stripHeaders: true
verbose: false
issuesWoLabels: false
maxIssues: 500
stripGeneratorNotice: true
compareLink: false
simpleList: true
- name: Upload changelog
uses: actions/upload-artifact@v4.3.3
with:
name: changelog
path: CHANGELOG.md
plugin_build:
env:
PLUGIN_NAME: hdr
runs-on: ubuntu-24.04
needs: version_and_changelog
container:
image: wuboyth/skyline-plugin-builder:latest
outputs:
trimmed_tag: ${{ steps.trimmed_tag.outputs.tag }}
steps:
# - name: setup python
# uses: actions/setup-python@v5.1.0
# with:
# python-version: '3.9' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- id: trimmed_tag
shell: bash
run: |
export UNTRIMMED=${{github.ref}}
export TRIMMED=${UNTRIMMED#"refs/tags/"}
echo "untrimmed: $UNTRIMMED"
echo "trimmed: $TRIMMED"
echo "##[set-output name=tag;]$TRIMMED";
- name: checkout version
uses: actions/checkout@v4.1.4
# build the project
- run: |
cd scripts && NO_RUST_NIGHTLY=1 python3 make_dist.py build version=${{ steps.trimmed_tag.outputs.tag }}-beta 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
uses: actions/upload-artifact@v4.3.3
with:
name: version
path: hdr_version.txt
- uses: dev-drprasad/delete-tag-and-release@master
with:
delete_release: true # default: false
tag_name: ${{ steps.trimmed_tag.outputs.tag }} # tag name to delete
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sleep to ensure tag gets deleted
uses: jakejarvis/wait-action@master
with:
time: '60s'
# upload asset
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: distributions/*
prerelease: false
file_glob: true
asset_name: the_asset
release_name: ${{ steps.trimmed_tag.outputs.tag }}-beta
tag: ${{ steps.trimmed_tag.outputs.tag }}
overwrite: true
body: ${{ needs.version_and_changelog.outputs.changelog }}
full_package:
runs-on: ubuntu-24.04
needs: [version_and_changelog, plugin_build]
steps:
- name: checkout version
uses: actions/checkout@v4.1.4
- id: romfs_latest
uses: pozetroninc/github-action-get-latest-release@master
with:
token: ${{ secrets.RELEASE_TOKEN }}
repository: HDR-Development/romfs-release
- name: Download romfs with chosen version
if: ${{ contains(github.event.inputs.romfs_version, 'latest') != true }}
id: get_romfs_not_latest
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'HDR-Development/romfs-release'
version: 'tags/${{ github.event.inputs.romfs_version }}'
file: 'romfs.zip'
token: ${{ secrets.RELEASE_TOKEN }}
- name: Download romfs with latest
if: ${{ contains(github.event.inputs.romfs_version, 'latest') }}
id: get_romfs_latest
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'HDR-Development/romfs-release'
version: '${{ github.event.inputs.romfs_version }}'
file: 'romfs.zip'
token: ${{ secrets.RELEASE_TOKEN }}
# make package depending on version chosen
- name: make package with chosen version
if: ${{ contains(github.event.inputs.romfs_version, 'latest') != true }}
run: |
python3 scripts/full_package.py ${{ needs.plugin_build.outputs.trimmed_tag }} none
- name: make package with latest
if: ${{ contains(github.event.inputs.romfs_version, 'latest') }}
run: |
python3 scripts/full_package.py ${{ needs.plugin_build.outputs.trimmed_tag }} none
# get the most recent latest full release
- id: package_latest
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: HDR-Development/HDR-Releases
# build the upgrade.zip and deletions.json
- name: make upgrade artifacts
run: |
python3 scripts/make_diff.py beta
- name: show upgrade artifacts
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
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-Releases
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
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-Releases
tag: ${{ steps.package_latest.outputs.release }}
overwrite: true
- uses: actions/download-artifact@v4.1.7
with:
name: changelog
- name: Display structure of downloaded changelog
run: ls -R && cp CHANGELOG.md artifacts
- uses: actions/download-artifact@v4.1.7
with:
name: version
# build the lvd files
# - id: lvd_files
# uses: robinraju/release-downloader@v1.7
# 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: 'beta'
# destination_repo: 'SuddyN/HDRStageTool'
# user_email: 'suddy121800@hotmail.com'
# user_name: 'SuddyN'
# destination_branch: 'gh-pages'
- name: Upload full package to betas
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-Releases
release_name: HDR Update ${{ needs.plugin_build.outputs.trimmed_tag }}-beta
tag: ${{ needs.plugin_build.outputs.trimmed_tag }}
overwrite: true
body: ${{ needs.version_and_changelog.outputs.changelog }}
################ handle the creation of to-prerelease.zip ################
to_prerelease:
runs-on: ubuntu-24.04
needs: [full_package, version_and_changelog]
steps:
- name: checkout version
uses: actions/checkout@v4.1.4
# download the prerelease
- id: latest_prerelease
uses: robinraju/release-downloader@v1.7
with:
repository: "HDR-Development/HDR-PreReleases"
latest: true
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