1- name : SmoothSSH Release - Zippy Zebra
1+ name : Build SmoothSSH Release
22
33on :
44 push :
5- tags :
6- - ' v*'
5+ branches : [ "main" ]
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : write
710
811jobs :
9- build :
12+ # ============================================================================
13+ # JOB 1: Android APKs
14+ # ============================================================================
15+ build-android :
16+ name : Build Android APKs
1017 runs-on : ubuntu-latest
1118 steps :
12- - uses : actions/checkout@v4
19+ - name : Checkout repository
20+ uses : actions/checkout@v4
1321
1422 - name : Extract Zippy Zebra Version
1523 id : get_version
1624 run : |
25+ # Finds the line in settings_screen.dart and extracts the string
1726 LINE=$(grep "applicationVersion:" lib/screens/settings_screen.dart)
1827 FULL_STRING=$(echo "$LINE" | sed "s/.*'\(.*\)'.*/\1/")
1928 VERSION_ONLY=$(echo "$FULL_STRING" | cut -d' ' -f1)
2029 RELEASE_NAME=$(echo "$FULL_STRING" | cut -d'-' -f2- | xargs)
30+
2131 echo "VERSION=$VERSION_ONLY" >> $GITHUB_ENV
2232 echo "REL_NAME=$RELEASE_NAME" >> $GITHUB_ENV
2333
24- - name : Set up Java
25- uses : actions/setup-java@v3
34+ - name : Setup Java
35+ uses : actions/setup-java@v4
2636 with :
2737 distribution : ' zulu'
2838 java-version : ' 17'
2939
30- - name : Set up Flutter
40+ - name : Setup Flutter
3141 uses : subosito/flutter-action@v2
3242 with :
3343 channel : ' stable'
3444
35- - name : Install Dependencies
45+ - name : Install dependencies
3646 run : flutter pub get
3747
38- - name : Build Android Artifacts
48+ - name : Build Android Bundle and Split APKs
3949 run : |
4050 flutter build appbundle --release
41- flutter build apk --release
51+ flutter build apk --split-per-abi
52+
53+ - name : Upload Android Artifacts
54+ uses : actions/upload-artifact@v4
55+ with :
56+ name : android-builds
57+ path : |
58+ build/app/outputs/flutter-apk/app-*-release.apk
59+ build/app/outputs/bundle/release/app-release.aab
60+
61+ # ============================================================================
62+ # JOB 2: Create GitHub Release
63+ # ============================================================================
64+ create-release :
65+ name : Create Release
66+ needs : [build-android]
67+ runs-on : ubuntu-latest
68+ steps :
69+ - name : Checkout repository
70+ uses : actions/checkout@v4
71+
72+ - name : Extract Zippy Zebra Version (for Release metadata)
73+ run : |
74+ LINE=$(grep "applicationVersion:" lib/screens/settings_screen.dart)
75+ FULL_STRING=$(echo "$LINE" | sed "s/.*'\(.*\)'.*/\1/")
76+ VERSION_ONLY=$(echo "$FULL_STRING" | cut -d' ' -f1)
77+ RELEASE_NAME=$(echo "$FULL_STRING" | cut -d'-' -f2- | xargs)
78+ echo "VERSION=$VERSION_ONLY" >> $GITHUB_ENV
79+ echo "REL_NAME=$RELEASE_NAME" >> $GITHUB_ENV
80+
81+ - name : Download all artifacts
82+ uses : actions/download-artifact@v4
83+ with :
84+ name : android-builds
85+ path : artifacts
4286
43- - name : Create GitHub Release
44- uses : softprops/action-gh-release@v1
87+ - name : Create Release and Upload Assets
88+ uses : softprops/action-gh-release@v2
4589 with :
90+ tag_name : " v${{ env.VERSION }}-${{ github.run_number }}"
4691 name : " SmoothSSH: ${{ env.REL_NAME }}"
47- tag_name : ${{ github.ref_name }}
4892 body : |
4993 ### 🦓 Release: ${{ env.REL_NAME }}
50- **App Version:** ${{ env.VERSION }}
94+ **Version:** ${{ env.VERSION }}
95+ **Build Number:** ${{ github.run_number }}
96+
97+ Automated build for SmoothSSH. Includes split APKs for various Android architectures and the full App Bundle.
5198 files : |
52- build/app/outputs/bundle/release/app-release.aab
53- build/app/outputs/flutter-apk/app-release.apk
99+ artifacts/**/*.apk
100+ artifacts/**/*.aab
54101 env :
55102 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments