-
Notifications
You must be signed in to change notification settings - Fork 0
532 lines (463 loc) · 24.6 KB
/
Copy pathrelease.yml
File metadata and controls
532 lines (463 loc) · 24.6 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
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
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
name: Release
on:
release:
types: [published]
permissions:
contents: write
env:
PERRY_LICENSE_KEY: ${{ secrets.PERRY_LICENSE_KEY }}
PERRY_API_TOKEN: ${{ secrets.PERRY_API_TOKEN }}
jobs:
# ─────────────────────────────────────────────
# iOS → TestFlight
# ─────────────────────────────────────────────
build-ios:
name: iOS (TestFlight)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Install perry
run: |
mkdir -p /tmp/perry-install
PERRY_TAG=$(for t in $(gh release list --repo PerryTS/perry --exclude-drafts --limit 15 --json tagName --jq '.[].tagName'); do gh release view "$t" --repo PerryTS/perry --json assets --jq '.assets[].name' 2>/dev/null | grep -q 'perry-linux-x86_64.tar.gz' && { echo "$t"; break; }; done)
echo "Installing perry $PERRY_TAG"
gh release download "$PERRY_TAG" --repo PerryTS/perry --pattern 'perry-linux-x86_64.tar.gz' --dir /tmp/perry-install
tar xzf /tmp/perry-install/perry-linux-x86_64.tar.gz -C /tmp/perry-install
sudo mv /tmp/perry-install/perry /usr/local/bin/
rm -rf /tmp/perry-install
perry --version
env:
GH_TOKEN: ${{ github.token }}
- name: Configure perry
run: |
mkdir -p ~/.perry
printf 'license_key = "%s"\nserver = "https://hub.perryts.com"\napi_token = "%s"\n' \
"$PERRY_LICENSE_KEY" "$PERRY_API_TOKEN" > ~/.perry/config.toml
- name: Set version and build number
run: |
VERSION="${GITHUB_REF_NAME#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" perry.toml
sed -i "s/^build_number = .*/build_number = ${{ github.run_number }}/" perry.toml
- name: Decode signing credentials
run: |
echo "${{ secrets.APPLE_IOS_P12 }}" | base64 -d > /tmp/ios_distribution.p12
echo "${{ secrets.APPLE_IOS_PROVISIONING_PROFILE }}" | base64 -d > /tmp/ios.mobileprovision
echo "${{ secrets.APPLE_P8_KEY }}" | base64 -d > /tmp/appstore_connect.p8
- name: Inject credential paths into perry.toml
run: |
sed -i '/^\[ios\]/,/^\[/{s|^certificate = .*|certificate = "/tmp/ios_distribution.p12"|}' perry.toml
sed -i '/^\[ios\]/,/^\[/{s|^provisioning_profile = .*|provisioning_profile = "/tmp/ios.mobileprovision"|}' perry.toml
- name: Publish iOS to TestFlight
run: |
perry publish ios \
--certificate /tmp/ios_distribution.p12 \
--provisioning-profile /tmp/ios.mobileprovision \
--apple-p8-key /tmp/appstore_connect.p8 \
--apple-key-id "$PERRY_APPLE_KEY_ID" \
--apple-issuer-id "$PERRY_APPLE_ISSUER_ID" \
--apple-team-id "$PERRY_APPLE_TEAM_ID"
env:
PERRY_APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
PERRY_APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
PERRY_APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
PERRY_APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
# ─────────────────────────────────────────────
# tvOS → TestFlight
# ─────────────────────────────────────────────
build-tvos:
name: tvOS (TestFlight)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Install perry
run: |
mkdir -p /tmp/perry-install
PERRY_TAG=$(for t in $(gh release list --repo PerryTS/perry --exclude-drafts --limit 15 --json tagName --jq '.[].tagName'); do gh release view "$t" --repo PerryTS/perry --json assets --jq '.assets[].name' 2>/dev/null | grep -q 'perry-linux-x86_64.tar.gz' && { echo "$t"; break; }; done)
echo "Installing perry $PERRY_TAG"
gh release download "$PERRY_TAG" --repo PerryTS/perry --pattern 'perry-linux-x86_64.tar.gz' --dir /tmp/perry-install
tar xzf /tmp/perry-install/perry-linux-x86_64.tar.gz -C /tmp/perry-install
sudo mv /tmp/perry-install/perry /usr/local/bin/
rm -rf /tmp/perry-install
perry --version
env:
GH_TOKEN: ${{ github.token }}
- name: Configure perry
run: |
mkdir -p ~/.perry
printf 'license_key = "%s"\nserver = "https://hub.perryts.com"\napi_token = "%s"\n' \
"$PERRY_LICENSE_KEY" "$PERRY_API_TOKEN" > ~/.perry/config.toml
- name: Set version and build number
run: |
VERSION="${GITHUB_REF_NAME#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" perry.toml
sed -i "s/^build_number = .*/build_number = ${{ github.run_number }}/" perry.toml
- name: Decode signing credentials
run: |
echo "${{ secrets.APPLE_IOS_P12 }}" | base64 -d > /tmp/tvos_distribution.p12
echo "${{ secrets.APPLE_TVOS_PROVISIONING_PROFILE }}" | base64 -d > /tmp/tvos.mobileprovision
echo "${{ secrets.APPLE_P8_KEY }}" | base64 -d > /tmp/appstore_connect.p8
- name: Inject credential paths into perry.toml
run: |
sed -i '/^\[tvos\]/,/^\[/{s|^certificate = .*|certificate = "/tmp/tvos_distribution.p12"|}' perry.toml
sed -i '/^\[tvos\]/,/^\[/{s|^provisioning_profile = .*|provisioning_profile = "/tmp/tvos.mobileprovision"|}' perry.toml
- name: Publish tvOS to TestFlight
run: |
perry publish tvos \
--certificate /tmp/tvos_distribution.p12 \
--provisioning-profile /tmp/tvos.mobileprovision \
--apple-p8-key /tmp/appstore_connect.p8 \
--apple-key-id "$PERRY_APPLE_KEY_ID" \
--apple-issuer-id "$PERRY_APPLE_ISSUER_ID" \
--apple-team-id "$PERRY_APPLE_TEAM_ID"
env:
PERRY_APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
PERRY_APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
PERRY_APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
PERRY_APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
# ─────────────────────────────────────────────
# watchOS → TestFlight (standalone)
# ─────────────────────────────────────────────
build-watchos:
name: watchOS (TestFlight)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Install perry
run: |
mkdir -p /tmp/perry-install
PERRY_TAG=$(for t in $(gh release list --repo PerryTS/perry --exclude-drafts --limit 15 --json tagName --jq '.[].tagName'); do gh release view "$t" --repo PerryTS/perry --json assets --jq '.assets[].name' 2>/dev/null | grep -q 'perry-linux-x86_64.tar.gz' && { echo "$t"; break; }; done)
echo "Installing perry $PERRY_TAG"
gh release download "$PERRY_TAG" --repo PerryTS/perry --pattern 'perry-linux-x86_64.tar.gz' --dir /tmp/perry-install
tar xzf /tmp/perry-install/perry-linux-x86_64.tar.gz -C /tmp/perry-install
sudo mv /tmp/perry-install/perry /usr/local/bin/
rm -rf /tmp/perry-install
perry --version
env:
GH_TOKEN: ${{ github.token }}
- name: Configure perry
run: |
mkdir -p ~/.perry
printf 'license_key = "%s"\nserver = "https://hub.perryts.com"\napi_token = "%s"\n' \
"$PERRY_LICENSE_KEY" "$PERRY_API_TOKEN" > ~/.perry/config.toml
- name: Set version and build number
run: |
VERSION="${GITHUB_REF_NAME#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" perry.toml
sed -i "s/^build_number = .*/build_number = ${{ github.run_number }}/" perry.toml
- name: Decode signing credentials
run: |
echo "${{ secrets.APPLE_IOS_P12 }}" | base64 -d > /tmp/watchos_distribution.p12
echo "${{ secrets.APPLE_WATCHOS_PROVISIONING_PROFILE }}" | base64 -d > /tmp/watchos.mobileprovision
echo "${{ secrets.APPLE_P8_KEY }}" | base64 -d > /tmp/appstore_connect.p8
- name: Inject credential paths into perry.toml
run: |
sed -i '/^\[watchos\]/,/^\[/{s|^certificate = .*|certificate = "/tmp/watchos_distribution.p12"|}' perry.toml
sed -i '/^\[watchos\]/,/^\[/{s|^provisioning_profile = .*|provisioning_profile = "/tmp/watchos.mobileprovision"|}' perry.toml
- name: Publish watchOS to TestFlight
run: |
perry publish watchos \
--certificate /tmp/watchos_distribution.p12 \
--provisioning-profile /tmp/watchos.mobileprovision \
--apple-p8-key /tmp/appstore_connect.p8 \
--apple-key-id "$PERRY_APPLE_KEY_ID" \
--apple-issuer-id "$PERRY_APPLE_ISSUER_ID" \
--apple-team-id "$PERRY_APPLE_TEAM_ID"
env:
PERRY_APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
PERRY_APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
PERRY_APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
PERRY_APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
# ─────────────────────────────────────────────
# macOS → App Store
# ─────────────────────────────────────────────
build-macos:
name: macOS (App Store + DMG)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Install perry
run: |
mkdir -p /tmp/perry-install
PERRY_TAG=$(for t in $(gh release list --repo PerryTS/perry --exclude-drafts --limit 15 --json tagName --jq '.[].tagName'); do gh release view "$t" --repo PerryTS/perry --json assets --jq '.assets[].name' 2>/dev/null | grep -q 'perry-linux-x86_64.tar.gz' && { echo "$t"; break; }; done)
echo "Installing perry $PERRY_TAG"
gh release download "$PERRY_TAG" --repo PerryTS/perry --pattern 'perry-linux-x86_64.tar.gz' --dir /tmp/perry-install
tar xzf /tmp/perry-install/perry-linux-x86_64.tar.gz -C /tmp/perry-install
sudo mv /tmp/perry-install/perry /usr/local/bin/
rm -rf /tmp/perry-install
perry --version
env:
GH_TOKEN: ${{ github.token }}
- name: Configure perry
run: |
mkdir -p ~/.perry
printf 'license_key = "%s"\nserver = "https://hub.perryts.com"\napi_token = "%s"\n' \
"$PERRY_LICENSE_KEY" "$PERRY_API_TOKEN" > ~/.perry/config.toml
- name: Set version and build number
run: |
VERSION="${GITHUB_REF_NAME#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" perry.toml
sed -i "s/^build_number = .*/build_number = ${{ github.run_number }}/" perry.toml
- name: Decode signing credentials
run: |
echo "${{ secrets.APPLE_APPSTORE_P12 }}" | base64 -d > /tmp/macos_appstore.p12
echo "${{ secrets.APPLE_INSTALLER_P12 }}" | base64 -d > /tmp/macos_installer.p12
echo "${{ secrets.APPLE_DEVID_P12 }}" | base64 -d > /tmp/macos_devid.p12
echo "${{ secrets.APPLE_P8_KEY }}" | base64 -d > /tmp/appstore_connect.p8
echo "${{ secrets.APPLE_MACOS_PROVISIONING_PROFILE }}" | base64 -d > /tmp/macos.provisionprofile
- name: Inject credential paths into perry.toml
run: |
sed -i '/^\[macos\]/,/^\[/{s|^certificate = .*|certificate = "/tmp/macos_appstore.p12"|}' perry.toml
sed -i '/^\[macos\]/,/^\[/{s|^installer_certificate = .*|installer_certificate = "/tmp/macos_installer.p12"|}' perry.toml
sed -i '/^\[macos\]/,/^\[/{s|^notarize_certificate = .*|notarize_certificate = "/tmp/macos_devid.p12"|}' perry.toml
sed -i '/^\[macos\]/,/^\[/{s|^provisioning_profile = .*|provisioning_profile = "/tmp/macos.provisionprofile"|}' perry.toml
- name: Publish macOS (App Store + notarized DMG)
run: |
# perry.toml has distribute = "both": uploads the .pkg to App Store
# Connect AND builds a Developer ID-signed, notarized .dmg, which is
# downloaded to dist/.
perry publish macos \
--certificate /tmp/macos_appstore.p12 \
--provisioning-profile /tmp/macos.provisionprofile \
--apple-p8-key /tmp/appstore_connect.p8 \
--apple-key-id "$PERRY_APPLE_KEY_ID" \
--apple-issuer-id "$PERRY_APPLE_ISSUER_ID" \
--apple-team-id "$PERRY_APPLE_TEAM_ID"
env:
PERRY_APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
PERRY_APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
PERRY_APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
PERRY_APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
- name: Attach notarized DMG to GitHub release
run: |
DMG=$(ls dist/*.dmg 2>/dev/null | head -1)
if [ -z "$DMG" ]; then
echo "::error::No notarized DMG found in dist/ — expected from distribute = \"both\""
ls -la dist/ 2>/dev/null || true
exit 1
fi
VERSION="${GITHUB_REF_NAME#v}"
CLEAN="BloomJump-${VERSION}-macOS.dmg"
cp "$DMG" "$CLEAN"
echo "Uploading $CLEAN to release $GITHUB_REF_NAME"
gh release upload "$GITHUB_REF_NAME" "$CLEAN" --clobber --repo "$GITHUB_REPOSITORY"
env:
GH_TOKEN: ${{ github.token }}
# ─────────────────────────────────────────────
# Android → Play Store
# ─────────────────────────────────────────────
build-android:
name: Android (Play Store)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Install perry
run: |
mkdir -p /tmp/perry-install
PERRY_TAG=$(for t in $(gh release list --repo PerryTS/perry --exclude-drafts --limit 15 --json tagName --jq '.[].tagName'); do gh release view "$t" --repo PerryTS/perry --json assets --jq '.assets[].name' 2>/dev/null | grep -q 'perry-linux-x86_64.tar.gz' && { echo "$t"; break; }; done)
echo "Installing perry $PERRY_TAG"
gh release download "$PERRY_TAG" --repo PerryTS/perry --pattern 'perry-linux-x86_64.tar.gz' --dir /tmp/perry-install
tar xzf /tmp/perry-install/perry-linux-x86_64.tar.gz -C /tmp/perry-install
sudo mv /tmp/perry-install/perry /usr/local/bin/
rm -rf /tmp/perry-install
perry --version
env:
GH_TOKEN: ${{ github.token }}
- name: Configure perry
run: |
mkdir -p ~/.perry
printf 'license_key = "%s"\nserver = "https://hub.perryts.com"\napi_token = "%s"\n' \
"$PERRY_LICENSE_KEY" "$PERRY_API_TOKEN" > ~/.perry/config.toml
- name: Set version and build number
run: |
VERSION="${GITHUB_REF_NAME#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" perry.toml
sed -i "s/^build_number = .*/build_number = ${{ github.run_number }}/" perry.toml
- name: Decode signing credentials
run: |
echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 -d > /tmp/release.keystore
echo "${{ secrets.GOOGLE_PLAY_KEY_JSON }}" | base64 -d > /tmp/googleplay.json
- name: Inject credential paths into perry.toml
run: |
sed -i 's|^google_play_key = ".*"|google_play_key = "/tmp/googleplay.json"|' perry.toml
sed -i 's|^keystore = ".*"|keystore = "/tmp/release.keystore"|' perry.toml
- name: Publish Android to Play Store
run: perry publish android
env:
PERRY_ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
# ─────────────────────────────────────────────
# Windows → GitHub Release
# ─────────────────────────────────────────────
build-windows:
name: Windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Install perry
run: |
mkdir -p /tmp/perry-install
PERRY_TAG=$(for t in $(gh release list --repo PerryTS/perry --exclude-drafts --limit 15 --json tagName --jq '.[].tagName'); do gh release view "$t" --repo PerryTS/perry --json assets --jq '.assets[].name' 2>/dev/null | grep -q 'perry-linux-x86_64.tar.gz' && { echo "$t"; break; }; done)
echo "Installing perry $PERRY_TAG"
gh release download "$PERRY_TAG" --repo PerryTS/perry --pattern 'perry-linux-x86_64.tar.gz' --dir /tmp/perry-install
tar xzf /tmp/perry-install/perry-linux-x86_64.tar.gz -C /tmp/perry-install
sudo mv /tmp/perry-install/perry /usr/local/bin/
rm -rf /tmp/perry-install
perry --version
env:
GH_TOKEN: ${{ github.token }}
- name: Configure perry
run: |
mkdir -p ~/.perry
printf 'license_key = "%s"\nserver = "https://hub.perryts.com"\napi_token = "%s"\n' \
"$PERRY_LICENSE_KEY" "$PERRY_API_TOKEN" > ~/.perry/config.toml
- name: Set version and build number
run: |
VERSION="${GITHUB_REF_NAME#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" perry.toml
sed -i "s/^build_number = .*/build_number = ${{ github.run_number }}/" perry.toml
- name: Decode Windows signing credentials
run: |
if [ -n "$WINDOWS_KMS_CERT_B64" ] && [ -n "$WINDOWS_KMS_SA_B64" ] && [ -n "$WINDOWS_KMS_KEY" ]; then
echo "$WINDOWS_KMS_CERT_B64" | base64 -d > /tmp/win_codesign.crt
echo "$WINDOWS_KMS_SA_B64" | base64 -d > /tmp/win_kms_sa.json
# Inject the KMS key resource name into [windows] (kept out of the repo)
sed -i '/^\[windows\]/a gcloud_kms_key = "'"$WINDOWS_KMS_KEY"'"' perry.toml
echo "Windows Google Cloud KMS code signing configured."
else
echo "::warning::Windows signing secrets (WINDOWS_KMS_CERT_B64 / WINDOWS_KMS_SA_B64 / WINDOWS_KMS_KEY) not set — the .exe will be UNSIGNED."
fi
env:
WINDOWS_KMS_CERT_B64: ${{ secrets.WINDOWS_KMS_CERT_B64 }}
WINDOWS_KMS_SA_B64: ${{ secrets.WINDOWS_KMS_SA_B64 }}
WINDOWS_KMS_KEY: ${{ secrets.WINDOWS_KMS_KEY }}
- name: Build for Windows
run: perry publish windows
- name: Upload to release
run: |
shopt -s nullglob
files=(dist/*.exe dist/*windows*)
if [ ${#files[@]} -eq 0 ]; then
echo "::warning::No Windows artifacts found in dist/"
ls -la dist/ || true
else
for f in "${files[@]}"; do
gh release upload "$GITHUB_REF_NAME" "$f" --clobber
done
fi
env:
GH_TOKEN: ${{ github.token }}
# ─────────────────────────────────────────────
# Linux → GitHub Release
# ─────────────────────────────────────────────
build-linux:
name: Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Install perry
run: |
mkdir -p /tmp/perry-install
PERRY_TAG=$(for t in $(gh release list --repo PerryTS/perry --exclude-drafts --limit 15 --json tagName --jq '.[].tagName'); do gh release view "$t" --repo PerryTS/perry --json assets --jq '.assets[].name' 2>/dev/null | grep -q 'perry-linux-x86_64.tar.gz' && { echo "$t"; break; }; done)
echo "Installing perry $PERRY_TAG"
gh release download "$PERRY_TAG" --repo PerryTS/perry --pattern 'perry-linux-x86_64.tar.gz' --dir /tmp/perry-install
tar xzf /tmp/perry-install/perry-linux-x86_64.tar.gz -C /tmp/perry-install
sudo mv /tmp/perry-install/perry /usr/local/bin/
rm -rf /tmp/perry-install
perry --version
env:
GH_TOKEN: ${{ github.token }}
- name: Configure perry
run: |
mkdir -p ~/.perry
printf 'license_key = "%s"\nserver = "https://hub.perryts.com"\napi_token = "%s"\n' \
"$PERRY_LICENSE_KEY" "$PERRY_API_TOKEN" > ~/.perry/config.toml
- name: Set version and build number
run: |
VERSION="${GITHUB_REF_NAME#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" perry.toml
sed -i "s/^build_number = .*/build_number = ${{ github.run_number }}/" perry.toml
- name: Build for Linux
run: perry publish linux
- name: Upload to release
run: |
shopt -s nullglob
files=(dist/*.AppImage dist/*linux*)
if [ ${#files[@]} -eq 0 ]; then
echo "::warning::No Linux artifacts found in dist/"
ls -la dist/ || true
else
for f in "${files[@]}"; do
gh release upload "$GITHUB_REF_NAME" "$f" --clobber
done
fi
env:
GH_TOKEN: ${{ github.token }}
# ─────────────────────────────────────────────
# Web → bloomengine.dev/jump/
# ─────────────────────────────────────────────
build-web:
name: Web (bloomengine.dev/jump)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Install perry
run: |
mkdir -p /tmp/perry-install
PERRY_TAG=$(for t in $(gh release list --repo PerryTS/perry --exclude-drafts --limit 15 --json tagName --jq '.[].tagName'); do gh release view "$t" --repo PerryTS/perry --json assets --jq '.assets[].name' 2>/dev/null | grep -q 'perry-linux-x86_64.tar.gz' && { echo "$t"; break; }; done)
echo "Installing perry $PERRY_TAG"
gh release download "$PERRY_TAG" --repo PerryTS/perry --pattern 'perry-linux-x86_64.tar.gz' --dir /tmp/perry-install
tar xzf /tmp/perry-install/perry-linux-x86_64.tar.gz -C /tmp/perry-install
sudo mv /tmp/perry-install/perry /usr/local/bin/
rm -rf /tmp/perry-install
perry --version
env:
GH_TOKEN: ${{ github.token }}
- name: Configure perry
run: |
mkdir -p ~/.perry
printf 'license_key = "%s"\nserver = "https://hub.perryts.com"\napi_token = "%s"\n' \
"$PERRY_LICENSE_KEY" "$PERRY_API_TOKEN" > ~/.perry/config.toml
- name: Set version and build number
run: |
VERSION="${GITHUB_REF_NAME#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" perry.toml
sed -i "s/^build_number = .*/build_number = ${{ github.run_number }}/" perry.toml
- name: Install Rust target
run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack
uses: jetli/wasm-pack-action@v0.4.0
with:
# Don't auto-resolve "latest" — the action's GH-API call has been
# returning the stale v0.9.1, whose bundled wasm-opt rejects modern
# bloom_web bytecode ("failed to execute wasm-opt: exit code 1").
version: 'v0.14.0'
# bloom_web is built from the npm-installed engine (node_modules) by
# build-web.sh, so the runtime glue matches the game WASM's FFI ABI.
# No separate engine clone needed.
- name: Build web bundle
run: ./build-web.sh
- name: Deploy to bloomengine.dev
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
echo "${{ secrets.DEPLOY_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
rsync -avz --delete \
-e "ssh -i ~/.ssh/deploy_key -o UserKnownHostsFile=~/.ssh/known_hosts" \
dist/web/ root@webserver.skelpo.net:/var/www/bloomengine.dev/jump/
echo "Deployed to https://bloomengine.dev/jump/"