1- name : EAS Build & Submit
1+ name : Self-Hosted Mobile Build & Submit
22
33on :
44 push :
2525 type : boolean
2626
2727concurrency :
28- group : eas -${{ github.ref }}
28+ group : self-hosted-mobile -${{ github.ref }}
2929 cancel-in-progress : false
3030
3131jobs :
3232 ci :
3333 name : CI checks
34- runs-on : ubuntu-latest
34+ runs-on : [self-hosted, macOS, eclipse-timer]
3535 steps :
3636 - name : Checkout
3737 uses : actions/checkout@v4
5858 run : pnpm test
5959
6060 build :
61- name : EAS Build (${{ github.event.inputs.platform || 'all' }})
61+ name : Local Build (${{ github.event.inputs.platform || 'all' }})
6262 needs : ci
63- runs-on : ubuntu-latest
63+ runs-on : [self-hosted, macOS, eclipse-timer]
6464 env :
6565 GOOGLE_MAPS_ANDROID_API_KEY : ${{ secrets.GOOGLE_MAPS_ANDROID_API_KEY }}
6666
@@ -97,15 +97,60 @@ jobs:
9797
9898 - name : Build
9999 working-directory : apps/mobile
100- run : eas build --profile production --platform ${{ github.event.inputs.platform || 'all' }} --non-interactive
100+ env :
101+ EAS_LOCAL_BUILD_ARTIFACTS_DIR : ${{ github.workspace }}/artifacts/raw
102+ run : |
103+ set -euo pipefail
104+ platform="${{ github.event.inputs.platform || 'all' }}"
105+
106+ if [ "$platform" = "all" ] || [ "$platform" = "ios" ]; then
107+ pnpm exec eas build --profile production --platform ios --local --non-interactive
108+ fi
109+
110+ if [ "$platform" = "all" ] || [ "$platform" = "android" ]; then
111+ pnpm exec eas build --profile production --platform android --local --non-interactive
112+ fi
113+
114+ - name : Collect build artifacts
115+ run : |
116+ set -euo pipefail
117+ mkdir -p artifacts/submission
118+ platform="${{ github.event.inputs.platform || 'all' }}"
119+
120+ if [ "$platform" = "all" ] || [ "$platform" = "ios" ]; then
121+ ios_artifact="$(find artifacts/raw -type f -name '*.ipa' | head -n 1 || true)"
122+ if [ -z "$ios_artifact" ]; then
123+ echo "Missing iOS artifact (.ipa) in artifacts/raw."
124+ exit 1
125+ fi
126+ cp "$ios_artifact" artifacts/submission/ios.ipa
127+ fi
128+
129+ if [ "$platform" = "all" ] || [ "$platform" = "android" ]; then
130+ android_artifact="$(find artifacts/raw -type f -name '*.aab' | head -n 1 || true)"
131+ if [ -z "$android_artifact" ]; then
132+ echo "Missing Android artifact (.aab) in artifacts/raw."
133+ exit 1
134+ fi
135+ cp "$android_artifact" artifacts/submission/android.aab
136+ fi
137+
138+ ls -lah artifacts/submission
139+
140+ - name : Upload build artifacts
141+ uses : actions/upload-artifact@v4
142+ with :
143+ name : local-mobile-builds-${{ github.run_id }}
144+ path : artifacts/submission
145+ if-no-files-found : error
101146
102147 submit :
103148 name : Submit to stores
104149 needs : build
105150 if : >-
106151 github.event_name == 'workflow_dispatch' &&
107152 github.event.inputs.submit == 'true'
108- runs-on : ubuntu-latest
153+ runs-on : [self-hosted, macOS, eclipse-timer]
109154 environment : production # Requires manual approval in GitHub settings
110155
111156 steps :
@@ -130,6 +175,31 @@ jobs:
130175 eas-version : latest
131176 token : ${{ secrets.EXPO_TOKEN }}
132177
133- - name : Submit to App Store Connect & Google Play
178+ - name : Download build artifacts
179+ uses : actions/download-artifact@v4
180+ with :
181+ name : local-mobile-builds-${{ github.run_id }}
182+ path : artifacts/submission
183+
184+ - name : Submit local artifacts to App Store Connect & Google Play
134185 working-directory : apps/mobile
135- run : eas submit --platform ${{ github.event.inputs.platform || 'all' }} --non-interactive --latest
186+ run : |
187+ set -euo pipefail
188+ platform="${{ github.event.inputs.platform || 'all' }}"
189+ artifact_root="${{ github.workspace }}/artifacts/submission"
190+
191+ if [ "$platform" = "all" ] || [ "$platform" = "ios" ]; then
192+ if [ ! -f "$artifact_root/ios.ipa" ]; then
193+ echo "Missing iOS artifact at $artifact_root/ios.ipa."
194+ exit 1
195+ fi
196+ pnpm exec eas submit --platform ios --path "$artifact_root/ios.ipa" --non-interactive
197+ fi
198+
199+ if [ "$platform" = "all" ] || [ "$platform" = "android" ]; then
200+ if [ ! -f "$artifact_root/android.aab" ]; then
201+ echo "Missing Android artifact at $artifact_root/android.aab."
202+ exit 1
203+ fi
204+ pnpm exec eas submit --platform android --path "$artifact_root/android.aab" --non-interactive
205+ fi
0 commit comments