-
Notifications
You must be signed in to change notification settings - Fork 17
278 lines (238 loc) · 8.21 KB
/
release.yml
File metadata and controls
278 lines (238 loc) · 8.21 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
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
name: Release
on:
push:
branches:
- main
- dev
tags:
- "v*.*.*"
paths:
- "build.rs"
- "src/**"
- "Cargo.toml"
- "Cargo.lock"
- "package/**"
- "scripts/**"
- "containers/**"
- ".github/workflows/release.yml"
pull_request:
workflow_dispatch:
permissions:
contents: write
env:
VERSION_NAME: ${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
jobs:
# ==================================================================================
# Build & Bundle Jobs: Run the platform-specific build scripts.
# ==================================================================================
build-linux:
name: Build for Linux
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
arch: x86_64-v3
- runner: ubuntu-24.04
arch: x86_64-v2
- runner: ubuntu-24.04
arch: x86_64
- runner: ubuntu-24.04-arm
arch: arm64
- runner: ubuntu-24.04
arch: x86
- runner: ubuntu-24.04-arm
arch: armhf
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
file: containers/Dockerfile.${{ runner.arch }}
load: true
tags: builder
cache-from: type=gha
cache-to: type=gha
- name: Build binary
run: docker run -v "$(pwd):/io" -w /io builder scripts/build-linux.sh ${{ matrix.arch }}
- name: Package AppImage
run: ./scripts/package-linux.sh ${{ env.VERSION_NAME }} ${{ matrix.arch }}
- name: Upload Linux distributables
uses: actions/upload-artifact@v7
with:
name: dist-linux-${{ matrix.arch }}
path: dist/*
build-windows:
name: Build for Windows
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: windows-2025
platform: windows
arch: x86_64-v3
- runner: windows-2025
platform: windows
arch: x86_64-v2
- runner: windows-2025
platform: windows
arch: x86_64
- runner: windows-11-arm
platform: windows
arch: arm64
- runner: windows-2025
platform: windows
arch: x86
- runner: windows-2022
platform: windows-legacy
arch: x86_64
- runner: windows-2022
platform: windows-legacy
arch: x86
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "21"
- name: Install Rust toolchain
uses: dtolnay/[email protected]
with:
components: rust-src
- name: Download VC-LTL5
shell: pwsh
run: |
Invoke-WebRequest -Uri "https://github.com/Chuyu-Team/VC-LTL5/releases/latest/download/VC-LTL-Binary.7z" -OutFile "VC-LTL-Binary.7z"
7z x VC-LTL-Binary.7z -oVC-LTL-Binary
- name: Download YY-Thunks
if: matrix.platform == 'windows-legacy'
shell: pwsh
run: |
Invoke-WebRequest -Uri "https://github.com/Chuyu-Team/YY-Thunks/releases/latest/download/YY-Thunks-Objs.zip" -OutFile "YY-Thunks-Objs.zip"
7z x YY-Thunks-Objs.zip -oYY-Thunks-Objs
- name: Build and package binary
shell: pwsh
run: |
.\scripts\build-windows.ps1 -Platform ${{ matrix.platform }} -Arch ${{ matrix.arch }}
.\scripts\package-windows.ps1 -VersionName ${{ env.VERSION_NAME }} -Platform ${{ matrix.platform }} -Arch ${{ matrix.arch }}
- name: Upload Windows distributables
uses: actions/upload-artifact@v7
with:
name: dist-${{ matrix.platform }}-${{ matrix.arch }}
path: dist/*
build-macos:
name: Build for macOS
runs-on: macos-26
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
- arch: x86_64
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Install LLVM and Clang
run: brew install llvm@21
- name: Install Rust toolchain
uses: dtolnay/[email protected]
with:
components: rust-src
- name: Install appdmg
run: npm i -g appdmg
- name: Build and package
run: |
scripts/build-macos.sh ${{ matrix.arch }}
scripts/package-macos.sh ${{ env.VERSION_NAME }} ${{ matrix.arch }}
- name: Upload macOS distributables
uses: actions/upload-artifact@v7
with:
name: dist-macos-${{ matrix.arch }}
path: dist/*
build-macos-universal:
name: Build for macOS (Universal)
runs-on: macos-26
needs: [build-macos]
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Download macOS distributables
uses: actions/download-artifact@v8
with:
pattern: "dist-macos-*"
merge-multiple: true
- name: Create the Universal2 app
run: |
# Mount arm64 DMG and copy the app
hdiutil mount TinyWiiBackupManager-${{ env.VERSION_NAME }}-macos-arm64.dmg
cp -r /Volumes/TinyWiiBackupManager/TinyWiiBackupManager.app TinyWiiBackupManager.app
hdiutil unmount /Volumes/TinyWiiBackupManager
# Mount x86_64 DMG and extract the binary
hdiutil mount TinyWiiBackupManager-${{ env.VERSION_NAME }}-macos-x86_64.dmg
cp /Volumes/TinyWiiBackupManager/TinyWiiBackupManager.app/Contents/MacOS/TinyWiiBackupManager TinyWiiBackupManager-x86_64
hdiutil unmount /Volumes/TinyWiiBackupManager
# Create the Universal binary
lipo -create \
-output TinyWiiBackupManager.app/Contents/MacOS/TinyWiiBackupManager \
TinyWiiBackupManager.app/Contents/MacOS/TinyWiiBackupManager \
TinyWiiBackupManager-x86_64
codesign --force --deep -s - TinyWiiBackupManager.app
- name: Install appdmg
run: npm i -g appdmg
- name: Create Universal DMG
run: |
mkdir dist
appdmg package/macos/appdmg-arm64.json "dist/TinyWiiBackupManager-${{ env.VERSION_NAME }}-macos-universal.dmg"
- name: Upload macOS distributables
uses: actions/upload-artifact@v7
with:
name: dist-macos-universal
path: dist/*
# ==================================================================================
# Release Job: Collects all artifacts and creates a single GitHub Release.
# ==================================================================================
release:
name: Create GitHub Release
if: github.ref_type == 'tag'
runs-on: ubuntu-slim
needs: [build-linux, build-windows, build-macos, build-macos-universal]
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Download distributables
uses: actions/download-artifact@v8
with:
path: dist
pattern: "dist-*" # This pattern will match all final distributable artifacts
merge-multiple: true # This places all matching artifacts into a single 'dist' directory
- name: Create version.txt
run: echo -n $(yq '.package.version' Cargo.toml) > version.txt # Write without line break
- name: Generate release notes
run: scripts/print-changes.py $VERSION_NAME > BODY.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/*
version.txt
body_path: BODY.md
prerelease: ${{ contains(env.VERSION_NAME, 'alpha') || contains(env.VERSION_NAME, 'beta') || contains(env.VERSION_NAME, 'rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}