99 - " package.json"
1010 - " bun.lock"
1111 workflow_call :
12+ inputs :
13+ build_aab :
14+ description : " Whether to build AAB in addition to APK"
15+ required : false
16+ type : boolean
17+ default : false
1218 outputs :
1319 artifact_name :
1420 description : " The name of the uploaded artifact"
1521 value : ${{ jobs.android_build.outputs.artifact_name }}
1622 apk_filename :
1723 description : " The filename of the APK"
1824 value : ${{ jobs.android_build.outputs.apk_filename }}
25+ aab_filename :
26+ description : " The filename of the AAB"
27+ value : ${{ jobs.android_build.outputs.aab_filename }}
1928
2029jobs :
2130 lint :
2534 uses : actions/checkout@v4
2635
2736 - name : 📦 Install signet app dependencies
28- run : nix develop .# --command bash -c "bun install ---- frozen-lockfile"
37+ run : nix develop .# --command bash -c "bun install --frozen-lockfile"
2938
3039 - name : ✨ Lint code
3140 run : nix develop .# --command bash -c "bun client lint"
3948 outputs :
4049 artifact_name : ${{ steps.rename_apk.outputs.artifact_name }}
4150 apk_filename : ${{ steps.rename_apk.outputs.apk_filename }}
51+ aab_filename : ${{ steps.aab_meta.outputs.aab_filename }}
4252 steps :
4353 - name : 🏗 Checkout code
4454 uses : actions/checkout@v4
5060 # uses: DeterminateSystems/magic-nix-cache-action@main
5161
5262 - name : 📦 Install signet app dependencies
53- run : nix develop .# --command bash -c "bun install ---- frozen-lockfile"
63+ run : nix develop .# --command bash -c "bun install --frozen-lockfile"
5464
5565 - name : 🔧 Create sentry.properties
5666 env :
@@ -70,12 +80,18 @@ jobs:
7080 MYAPP_RELEASE_KEY_PASSWORD : ${{ secrets.KEY_PASSWORD }}
7181 run : ./scripts/create_local_properties.sh
7282
73- - name : 🔨 Build signet Android app
83+ - name : 🔨 Build signet Android app (APK)
7484 run : nix develop .# --command bash -c "bun client build:android:ci"
7585
76- - name : 🧹 Clean up keystore
77- if : always()
78- run : rm -f client/android/app/release.keystore
86+ - name : 📦 Build signet Android app (AAB)
87+ if : ${{ inputs.build_aab }}
88+ run : nix develop .# --command bash -c "cd client/android && ./gradlew bundleSignetRelease -PreactNativeArchitectures=arm64-v8a"
89+
90+ - name : 🧹 Clean up keystore & local.properties
91+ if : ${{ always() }}
92+ run : |
93+ rm -f client/android/app/release.keystore
94+ rm -f client/android/local.properties
7995
8096 - name : 📝 Rename APK with timestamp
8197 id : rename_apk
@@ -91,8 +107,37 @@ jobs:
91107 echo "apk_filename=${apk_filename}" >> $GITHUB_OUTPUT
92108 shell : bash
93109
110+ - name : 📝 Prepare AAB outputs
111+ id : aab_meta
112+ # Always run so job outputs are defined whether or not we built an AAB
113+ if : ${{ always() }}
114+ shell : bash
115+ run : |
116+ set -euo pipefail
117+ aab_expected="client/android/app/build/outputs/bundle/signetRelease/app-signet-release.aab"
118+ if [[ "${{ inputs.build_aab }}" == 'true' && -f "$aab_expected" ]]; then
119+ timestamp=$(date +'%Y-%m-%d-%H-%M')
120+ aab_filename="noah-android-aab-${timestamp}.aab"
121+ new_aab_path="client/android/app/build/outputs/bundle/signetRelease/${aab_filename}"
122+ mv "$aab_expected" "$new_aab_path"
123+ echo "new_path=${new_aab_path}" >> "$GITHUB_OUTPUT"
124+ echo "aab_filename=${aab_filename}" >> "$GITHUB_OUTPUT"
125+ else
126+ echo "new_path=" >> "$GITHUB_OUTPUT"
127+ echo "aab_filename=" >> "$GITHUB_OUTPUT"
128+ fi
129+
94130 - name : 📤 Upload Android APK
95131 uses : actions/upload-artifact@v4
96132 with :
97133 name : ${{ steps.rename_apk.outputs.artifact_name }}
98134 path : ${{ steps.rename_apk.outputs.new_path }}
135+ if-no-files-found : error
136+
137+ - name : 📤 Upload Android AAB
138+ if : ${{ inputs.build_aab && steps.aab_meta.outputs.new_path != '' }}
139+ uses : actions/upload-artifact@v4
140+ with :
141+ name : ${{ steps.aab_meta.outputs.aab_filename }}
142+ path : ${{ steps.aab_meta.outputs.new_path }}
143+ if-no-files-found : error
0 commit comments