-
Notifications
You must be signed in to change notification settings - Fork 4
703 lines (599 loc) · 25.5 KB
/
debugbuild.yml
File metadata and controls
703 lines (599 loc) · 25.5 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
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
name: Debug Build - Floaty
on:
push:
branches:
- "**"
# Add explicit permissions for the workflow
permissions:
contents: write # Required for creating releases
actions: read # Required for downloading artifacts
env:
DEPLOYMENT_API_KEY: ${{ secrets.DEPLOYMENT_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
VERSION_BUMP:
name: Bump Version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check if version bump should be skipped
id: check_skip
run: |
COMMIT_MSG=$(git log -1 --pretty=%B)
echo "Commit message: $COMMIT_MSG"
if [[ "$COMMIT_MSG" == *"--no-bump"* ]]; then
echo "skip=true" >> $GITHUB_OUTPUT
echo "Skipping version bump"
else
echo "skip=false" >> $GITHUB_OUTPUT
echo "Proceeding with version bump"
fi
- name: Bump version
if: steps.check_skip.outputs.skip != 'true'
run: |
CURRENT_VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | cut -d'+' -f1 | tr -d '\r')
echo "Current version: $CURRENT_VERSION"
IFS='.' read -r major minor patch <<< "$CURRENT_VERSION"
NEW_PATCH=$((patch + 1))
NEW_VERSION="$major.$minor.$NEW_PATCH"
echo "New version: $NEW_VERSION"
sed -i "s/^version: .*/version: $NEW_VERSION/" pubspec.yaml
echo "Updated pubspec.yaml:"
grep '^version:' pubspec.yaml
- name: Commit version bump
if: steps.check_skip.outputs.skip != 'true'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Automated Version Bump
push_options: '--force'
skip_dirty_check: true
LINUX:
name: Linux
runs-on: ubuntu-22.04
needs: VERSION_BUMP
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.38.4"
cache: true
- name: Fix Git ownership for Flutter
run: |
git config --global --add safe.directory '*'
- name: Install Flutter dependencies
run: flutter pub get
- name: Install Linux build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libayatana-appindicator3-dev \
libmpv-dev \
libasound2-dev \
ninja-build \
clang \
pkg-config
- name: Set glibc compatibility
run: |
# Build with maximum glibc compatibility
export GLIBC_COMPATIBILITY=1
export CFLAGS="-march=x86-64 -mtune=generic"
export CXXFLAGS="-march=x86-64 -mtune=generic"
- name: Install dependencies for AppImage
run: |
wget -O appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool
mv appimagetool /usr/local/bin/
- name: Prepare make_config.yaml
run: |
OS=linux
for config_file in $(find "$OS/packaging" -type f -name "make_config_${GITHUB_REF_NAME}.yaml"); do
target_dir=$(dirname "$config_file")
cp "$config_file" "${target_dir}/make_config.yaml"
echo "Copied $config_file → ${target_dir}/make_config.yaml"
done
- name: Install Fastforge
run: dart pub global activate fastforge
- name: Build and release
run: fastforge release --name ${{ github.ref_name }}linux
- name: Replace AppRun
run: |
# Find the AppImage file
APPIMAGE_FILE=$(find dist -name "*.AppImage" -type f | head -1)
if [ -z "$APPIMAGE_FILE" ]; then
echo "No AppImage found, skipping AppRun replacement"
exit 0
fi
# Convert to absolute path
APPIMAGE_FILE="$(cd "$(dirname "$APPIMAGE_FILE")" && pwd)/$(basename "$APPIMAGE_FILE")"
echo "Found AppImage: $APPIMAGE_FILE"
# Make AppImage executable
chmod +x "$APPIMAGE_FILE"
# Extract the AppImage
APPIMAGE_DIR=$(mktemp -d)
echo "Extracting to: $APPIMAGE_DIR"
cd "$APPIMAGE_DIR"
"$APPIMAGE_FILE" --appimage-extract
# Check if extraction was successful
if [ ! -d squashfs-root ]; then
echo "Error: AppImage extraction failed"
exit 1
fi
# Replace the AppRun script with our distro-agnostic version
if [ -f squashfs-root/AppRun ]; then
cp "$GITHUB_WORKSPACE/linux/packaging/appimage/AppRun" squashfs-root/AppRun
chmod +x squashfs-root/AppRun
echo "Replaced AppRun script"
else
echo "Warning: AppRun not found in extracted AppImage"
fi
# Rebuild the AppImage
cd "$GITHUB_WORKSPACE"
appimagetool -n "$APPIMAGE_DIR/squashfs-root" "$APPIMAGE_FILE"
rm -rf "$APPIMAGE_DIR"
echo "AppImage rebuilt with custom AppRun"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-linux
path: dist/
ANDROID:
name: Android
runs-on: blacksmith-4vcpu-ubuntu-2404
needs: VERSION_BUMP
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.38.4"
cache: true
- name: Create secret files
run: |
mkdir -p lib/utils
mkdir -p android
echo "${{ secrets.keyproperties }}" | tr -d '\r' > android/key.properties
echo "${{ secrets.uploadkeystore }}" | base64 -d > android/app/upload-keystore.jks
echo "Created files:"
ls -la lib/ lib/utils android/ android/app/
- name: Install Flutter dependencies
run: flutter pub get
- name: Verify signing configuration
run: |
echo "Checking signing files:"
if [ -f android/key.properties ]; then
echo "✓ key.properties exists"
else
echo "✗ key.properties missing"
exit 1
fi
if [ -f android/app/upload-keystore.jks ]; then
echo "✓ Keystore exists"
else
echo "✗ Keystore missing"
exit 1
fi
- name: Clean before build
run: flutter clean
- name: Build signed Android APK
run: |
set -e
BRANCH="${{ github.ref_name }}"
# Map 'release' branch to 'stable' flavor for Android
if [[ "$BRANCH" == "release" ]]; then
FLAVOR="stable"
else
FLAVOR="$BRANCH"
fi
echo "Building Android APK for flavor: $FLAVOR"
if flutter build apk --release --flavor "$FLAVOR" --dart-define FLUTTER_FLAVOR=${{ github.ref_name }}; then
echo "flutter build apk succeeded"
else
echo "flutter build apk failed — attempting Gradle fallback to locate APKs"
cd android
# Capitalize first letter for Gradle variant name (e.g. nightly -> Nightly)
VAR_CAP="$(tr '[:lower:]' '[:upper:]' <<< "${FLAVOR:0:1}")${FLAVOR:1}"
echo "Attempting assemble${VAR_CAP}Release"
./gradlew --no-daemon assemble${VAR_CAP}Release || true
cd ..
# Try to find any APK produced by Gradle and copy into flutter-apk output dir
FOUND_APK=$(find . -path "*/build/*" -type f -name "*-${FLAVOR}-release.apk" -o -name "*-${VAR_CAP}Release.apk" -o -name "app-release.apk" | head -n 1 || true)
if [ -n "$FOUND_APK" ]; then
echo "Found APK: $FOUND_APK"
mkdir -p build/app/outputs/flutter-apk
cp "$FOUND_APK" "build/app/outputs/flutter-apk/app-${FLAVOR}-release.apk"
echo "Copied APK to build/app/outputs/flutter-apk/app-${FLAVOR}-release.apk"
else
echo "No APK found after Gradle fallback"
find . -path "*/build/*" -type f -name "*.apk" || true
exit 1
fi
fi
echo "Built APKs in flutter-apk dir:"
ls -la build/app/outputs/flutter-apk/ || true
echo "All APK files in build tree:"
find . -path "*/build/*" -type f -name "*.apk" || true
- name: Get version from pubspec.yaml
id: get_version
run: |
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | cut -d'+' -f1 | tr -d '\r')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
- name: Prepare APK for release
run: |
VERSION="${{ steps.get_version.outputs.version }}"
VERSION="$(echo -n "$VERSION" | tr -d '\r')"
# Map 'release' branch to 'stable' flavor
BRANCH="${{ github.ref_name }}"
if [[ "$BRANCH" == "release" ]]; then
FLAVOR="stable"
else
FLAVOR="$BRANCH"
fi
mkdir -p "dist/$VERSION"
APK_FLAVORED="build/app/outputs/flutter-apk/app-${FLAVOR}-release.apk"
APK_DEFAULT="build/app/outputs/flutter-apk/app-release.apk"
if [ -f "$APK_FLAVORED" ]; then
cp "$APK_FLAVORED" "dist/$VERSION/floaty-${VERSION}-android.apk"
echo "Copied flavored APK: $APK_FLAVORED"
elif [ -f "$APK_DEFAULT" ]; then
cp "$APK_DEFAULT" "dist/$VERSION/floaty-${VERSION}-android.apk"
echo "Copied default APK: $APK_DEFAULT"
else
echo "Error: No APK found to copy"
find build -name "*.apk" -type f || true
exit 1
fi
echo "APK prepared:"
ls -la "dist/$VERSION/"
- name: Upload Android APK
uses: actions/upload-artifact@v4
with:
name: dist-android
path: dist/
MACOSIOS:
name: MacOS & iOS
runs-on: macos-latest
needs: VERSION_BUMP
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.38.4"
cache: true
- name: Install appdmg
run: npm install -g appdmg
- name: Install Flutter dependencies
run: flutter pub get
- name: Prepare make_config.yaml
run: |
OS=macos
for config_file in $(find "$OS/packaging" -type f -name "make_config_${GITHUB_REF_NAME}.yaml"); do
target_dir=$(dirname "$config_file")
cp "$config_file" "${target_dir}/make_config.yaml"
echo "Copied $config_file → ${target_dir}/make_config.yaml"
done
- name: Install Fastforge
run: dart pub global activate fastforge
- name: Build and release
run: fastforge release --name ${{ github.ref_name }}macos
- name: Determine iOS flavor
id: ios_flavor
run: |
BRANCH="${{ github.ref_name }}"
if [[ "$BRANCH" == "release" ]]; then
FLAVOR="production"
elif [[ "$BRANCH" == "beta" ]]; then
FLAVOR="beta"
elif [[ "$BRANCH" == "nightly" ]]; then
FLAVOR="nightly"
elif [[ "$BRANCH" == "dev" ]]; then
FLAVOR="development"
else
FLAVOR="nightly"
fi
echo "flavor=$FLAVOR" >> $GITHUB_OUTPUT
echo "Building iOS with flavor: $FLAVOR"
- name: Build iOS app
run: flutter build ios --release --no-codesign --flavor ${{ steps.ios_flavor.outputs.flavor }} --dart-define FLUTTER_FLAVOR=${{ github.ref_name }}
- name: Get version from pubspec.yaml
id: get_version
run: |
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | cut -d'+' -f1 | tr -d '\r')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
- name: Package iOS IPA
run: |
VERSION="${{ steps.get_version.outputs.version }}"
VERSION="$(echo -n "$VERSION" | tr -d '\r')"
mkdir -p "dist/$VERSION"
mkdir -p Payload
cp -r build/ios/iphoneos/Runner.app Payload/
cd dist/$VERSION
zip -r "floaty-${VERSION}-ios.ipa" ../../Payload
cd ../..
rm -rf Payload
echo "Packaged IPA:"
ls -la "dist/$VERSION/"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-macos-ios
path: dist/
WINDOWS:
name: Windows
runs-on: windows-latest
needs: VERSION_BUMP
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.38.4"
cache: true
- name: Install Flutter dependencies
run: flutter pub get
- name: Prepare make_config.yaml
shell: bash #i hate powershell it can burn in hell
run: |
OS=windows
for config_file in $(find "$OS/packaging" -type f -name "make_config_${GITHUB_REF_NAME}.yaml"); do
target_dir=$(dirname "$config_file")
cp "$config_file" "${target_dir}/make_config.yaml"
echo "Copied $config_file → ${target_dir}/make_config.yaml"
done
- name: Install Fastforge
run: dart pub global activate fastforge
- name: Build and release
run: fastforge release --name ${{ github.ref_name }}windows
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-windows
path: dist
DEPLOY:
name: Deploy Release
needs: [LINUX, ANDROID, WINDOWS, MACOSIOS]
runs-on: ubuntu-latest
if: always() && (needs.LINUX.result == 'success' || needs.ANDROID.result == 'success' || needs.WINDOWS.result == 'success' || needs.MACOSIOS.result == 'success')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set timestamp variable
id: timestamp
run: echo "timestamp=$(date +%Y%m%d-%H%M%S)" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Organize build files
run: |
mkdir -p release/{windows,linux,android,macos,ios}
if [ -d "./artifacts/dist-linux" ]; then
find ./artifacts/dist-linux -name "*.rpm" -exec cp {} release/linux/ \;
find ./artifacts/dist-linux -name "*.deb" -exec cp {} release/linux/ \;
find ./artifacts/dist-linux -name "*.AppImage" -exec cp {} release/linux/ \;
fi
if [ -d "./artifacts/dist-android" ]; then
find ./artifacts/dist-android -name "*.apk" -exec cp {} release/android/ \;
fi
if [ -d "./artifacts/dist-windows" ]; then
find ./artifacts/dist-windows -name "*.exe" -exec cp {} release/windows/ \;
find ./artifacts/dist-windows -name "*.msi" -exec cp {} release/windows/ \;
fi
if [ -d "./artifacts/dist-macos-ios" ]; then
find ./artifacts/dist-macos-ios -name "*.dmg" -exec cp {} release/macos/ \;
find ./artifacts/dist-macos-ios -name "*.pkg" -exec cp {} release/macos/ \;
find ./artifacts/dist-macos-ios -name "*.ipa" -exec cp {} release/ios/ \;
fi
- name: Generate deployment manifest
run: |
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | tr -d ' ' || echo "1.0.0")
FLAVOR="${{ github.ref_name }}"
cat > release/manifest.json << EOF
{
"version": "$VERSION",
"flavor": "$FLAVOR",
"platforms": [
EOF
if ls release/windows/*.exe >/dev/null 2>&1 || ls release/windows/*.msi >/dev/null 2>&1; then
echo ' {' >> release/manifest.json
echo ' "platform": "windows",' >> release/manifest.json
echo ' "files": [' >> release/manifest.json
FIRST=true
for file in release/windows/*; do
if [ -f "$file" ]; then
[ "$FIRST" = false ] && echo ',' >> release/manifest.json
filename=$(basename "$file")
if [[ "$filename" == *.exe ]]; then
echo -n " {\"type\": \".exe Installer\", \"path\": \"windows/$filename\"}" >> release/manifest.json
elif [[ "$filename" == *.msi ]]; then
echo -n " {\"type\": \".msi Installer\", \"path\": \"windows/$filename\"}" >> release/manifest.json
fi
FIRST=false
fi
done
echo '' >> release/manifest.json
echo ' ]' >> release/manifest.json
echo ' },' >> release/manifest.json
fi
if ls release/linux/*.rpm >/dev/null 2>&1 || ls release/linux/*.deb >/dev/null 2>&1 || ls release/linux/*.AppImage >/dev/null 2>&1; then
echo ' {' >> release/manifest.json
echo ' "platform": "linux",' >> release/manifest.json
echo ' "files": [' >> release/manifest.json
FIRST=true
for file in release/linux/*; do
if [ -f "$file" ]; then
[ "$FIRST" = false ] && echo ',' >> release/manifest.json
filename=$(basename "$file")
if [[ "$filename" == *.rpm ]]; then
echo -n " {\"type\": \"RPM\", \"path\": \"linux/$filename\"}" >> release/manifest.json
elif [[ "$filename" == *.deb ]]; then
echo -n " {\"type\": \"DEB\", \"path\": \"linux/$filename\"}" >> release/manifest.json
elif [[ "$filename" == *.AppImage ]]; then
echo -n " {\"type\": \"AppImage\", \"path\": \"linux/$filename\"}" >> release/manifest.json
fi
FIRST=false
fi
done
echo '' >> release/manifest.json
echo ' ]' >> release/manifest.json
echo ' },' >> release/manifest.json
fi
if ls release/android/*.apk >/dev/null 2>&1; then
echo ' {' >> release/manifest.json
echo ' "platform": "android",' >> release/manifest.json
echo ' "files": [' >> release/manifest.json
FIRST=true
for file in release/android/*; do
if [ -f "$file" ]; then
[ "$FIRST" = false ] && echo ',' >> release/manifest.json
filename=$(basename "$file")
echo -n " {\"type\": \"APK\", \"path\": \"android/$filename\"}" >> release/manifest.json
FIRST=false
fi
done
echo '' >> release/manifest.json
echo ' ]' >> release/manifest.json
echo ' },' >> release/manifest.json
fi
if ls release/macos/*.dmg >/dev/null 2>&1 || ls release/macos/*.pkg >/dev/null 2>&1; then
echo ' {' >> release/manifest.json
echo ' "platform": "macos",' >> release/manifest.json
echo ' "files": [' >> release/manifest.json
FIRST=true
for file in release/macos/*; do
if [ -f "$file" ]; then
[ "$FIRST" = false ] && echo ',' >> release/manifest.json
filename=$(basename "$file")
if [[ "$filename" == *.dmg ]]; then
echo -n " {\"type\": \"DMG\", \"path\": \"macos/$filename\"}" >> release/manifest.json
elif [[ "$filename" == *.pkg ]]; then
echo -n " {\"type\": \"PKG\", \"path\": \"macos/$filename\"}" >> release/manifest.json
fi
FIRST=false
fi
done
echo '' >> release/manifest.json
echo ' ]' >> release/manifest.json
echo ' },' >> release/manifest.json
fi
if ls release/ios/*.ipa >/dev/null 2>&1; then
echo ' {' >> release/manifest.json
echo ' "platform": "ios",' >> release/manifest.json
echo ' "files": [' >> release/manifest.json
FIRST=true
for file in release/ios/*; do
if [ -f "$file" ]; then
[ "$FIRST" = false ] && echo ',' >> release/manifest.json
filename=$(basename "$file")
echo -n " {\"type\": \"IPA\", \"path\": \"ios/$filename\"}" >> release/manifest.json
FIRST=false
fi
done
echo '' >> release/manifest.json
echo ' ]' >> release/manifest.json
echo ' },' >> release/manifest.json
fi
sed -i '$ s/,$//' release/manifest.json
echo ' ]' >> release/manifest.json
echo ' }' >> release/manifest.json
- name: Create deployment package
run: |
PACKAGE_NAME="floaty-release-${{ github.ref_name }}-${{ steps.timestamp.outputs.timestamp }}.zip"
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
cd release
zip -r "../$PACKAGE_NAME" .
cd ..
- name: Display manifest content
run: cat release/manifest.json
- name: Deploy to API
id: deploy
run: |
echo "Deploying package: $PACKAGE_NAME"
if [ ! -f "$PACKAGE_NAME" ]; then
echo "Error: Package file $PACKAGE_NAME not found!"
ls -la
exit 1
fi
RESPONSE=$(curl -X POST \
-H "x-api-key: ${{ env.DEPLOYMENT_API_KEY }}" \
-F "artifact=@${PACKAGE_NAME}" \
-w "\n%{http_code}" \
"https://floaty.fyi/api/deploy" \
2>/dev/null)
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
RESPONSE_BODY=$(echo "$RESPONSE" | head -n -1)
echo "HTTP Response Code: $HTTP_CODE"
echo "Response Body: $RESPONSE_BODY"
if [ "$HTTP_CODE" -eq 200 ]; then
echo "Successfully deployed $PACKAGE_NAME"
echo "Response: $RESPONSE_BODY"
echo "deployment_response=$RESPONSE_BODY" >> $GITHUB_OUTPUT
DEPLOYMENT_ID=$(echo "$RESPONSE_BODY" | jq -r '.deploymentId // empty')
VERSION=$(echo "$RESPONSE_BODY" | jq -r '.version // empty')
FLAVOR=$(echo "$RESPONSE_BODY" | jq -r '.flavor // empty')
echo "deployment_id=$DEPLOYMENT_ID" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "flavor=$FLAVOR" >> $GITHUB_OUTPUT
echo "Deployment ID: $DEPLOYMENT_ID"
echo "Version: $VERSION"
echo "Flavor: $FLAVOR"
else
echo "Deployment failed with HTTP $HTTP_CODE"
echo "Error: $RESPONSE_BODY"
exit 1
fi
- name: Create GitHub Release
if: steps.deploy.outputs.deployment_id != ''
uses: softprops/action-gh-release@v2
with:
tag_name: "${{ steps.deploy.outputs.flavor }}-v${{ steps.deploy.outputs.version }}-${{ steps.deploy.outputs.deployment_id }}"
name: "${{ steps.deploy.outputs.flavor }} v${{ steps.deploy.outputs.version }}"
body: |
## ${{ steps.deploy.outputs.flavor }} Release v${{ steps.deploy.outputs.version }}
🔗 **[View Changelogs](https://floaty.fyi/changelogs#${{ steps.deploy.outputs.deployment_id }})**
This release includes builds for:
${{ needs.LINUX.result == 'success' && '- 🐧 Linux (RPM, DEB, AppImage)' || '' }}
${{ needs.ANDROID.result == 'success' && '- 🤖 Android (APK - signed)' || '' }}
${{ needs.WINDOWS.result == 'success' && '- 🪟 Windows (EXE Installer)' || '' }}
${{ needs.MACOSIOS.result == 'success' && '- 🍎 macOS (DMG, PKG)' || '' }}
${{ needs.MACOSIOS.result == 'success' && '- 📱 iOS (IPA)' || '' }}
**Deployment ID:** `${{ steps.deploy.outputs.deployment_id }}`
**Branch:** `${{ github.ref_name }}`
**Commit:** `${{ github.sha }}`
draft: false
prerelease: ${{ steps.deploy.outputs.flavor != 'release' }}
files: |
release/windows/*
release/linux/*
release/android/*
release/macos/*
release/ios/*
release/manifest.json
- name: Upload final package as artifact
uses: actions/upload-artifact@v4
with:
name: deployment-package
path: "${{ env.PACKAGE_NAME }}"
retention-days: 30