Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh

Commit

The phone app builds for Android on EAS from a workflow, so testers install it from a QR code before Google Play. mobile-build.yml runs by hand (preview, the default, or development) and on main when the app's native side changes; its summary links the build's page on expo.dev, whose QR code installs the APK, and the APK itself. Preview is g1t (beta), a standalone signed APK anyone with the link can install; code changes reach it over the air on the preview channel.

syntaqxcommitted Parentc8e1680Browse files
2 files+75−10/2 viewed
+71−0
1+# Builds the phone app for Android on EAS, to install from a link or a QR
2+# code before it is in Google Play. Nothing is published: the run's summary
3+# links the build's page on expo.dev, which shows the QR code, and the APK.
4+#
5+# - `preview` (default): g1t (beta), sh.g1t.app.preview, a standalone signed
6+# APK that needs no computer: what testers install, from the build page's
7+# QR code. Code changes reach it over the air (`eas update --channel
8+# preview`), so it is built again only when the native side changes; on
9+# main that happens by itself (the paths below). mobile-release.yml
10+# publishes these on g1t.sh/download.
11+# - `development`: g1t (dev), sh.g1t.app.dev, with expo-dev-client. It loads
12+# the app's code from `npx expo start` on your computer.
13+#
14+# Needs the repository secret EXPO_TOKEN (an Expo access token with access
15+# to @flagon-io/g1t).
16+name: Mobile build
17+
18+on:
19+ push:
20+ branches: [main]
21+ paths:
22+ - apps/mobile/app.config.ts
23+ - apps/mobile/eas.json
24+ - apps/mobile/package.json
25+ - apps/mobile/assets/images/**
26+ workflow_dispatch:
27+ inputs:
28+ profile:
29+ description: "The EAS build profile"
30+ type: choice
31+ options: [preview, development]
32+ default: preview
33+
34+permissions:
35+ contents: read
36+
37+concurrency:
38+ group: mobile-build-${{ inputs.profile || 'preview' }}
39+ cancel-in-progress: true
40+
41+jobs:
42+ build:
43+ name: Build Android (${{ inputs.profile || 'preview' }}) on EAS
44+ runs-on: ubuntu-latest
45+ timeout-minutes: 60
46+ env:
47+ PROFILE: ${{ inputs.profile || 'preview' }}
48+ steps:
49+ - uses: actions/checkout@v5
50+ - name: Build on EAS
51+ working-directory: apps/mobile
52+ env:
53+ EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
54+ run: |
55+ npx --yes eas-cli@24.12.1 build --platform android --profile "$PROFILE" \
56+ --non-interactive --wait --json > build.json
57+ node -e '
58+ const [build] = JSON.parse(require("fs").readFileSync("build.json", "utf8"));
59+ const page = `https://expo.dev/accounts/flagon-io/projects/g1t/builds/${build.id}`;
60+ const lines = [
61+ `### g1t for Android, ${process.env.PROFILE} build`,
62+ "",
63+ `- Status: ${build.status}`,
64+ `- Version: ${build.appVersion} (versionCode ${build.appBuildVersion})`,
65+ `- Install: open [the build on expo.dev](${page}) and scan its QR code with the phone`,
66+ build.artifacts?.buildUrl ? `- APK: ${build.artifacts.buildUrl}` : "",
67+ ];
68+ console.log(lines.join("\n"));
69+ require("fs").appendFileSync(process.env.GITHUB_STEP_SUMMARY, lines.join("\n") + "\n");
70+ if (build.status !== "FINISHED") process.exit(1);
71+ '
+4−1
147147 computer, signs in through `g1t://oauth/callback`, and gets notifications
148148 once Firebase is set up ([below](#push-notifications-on-android)). Build
149149 it again only when a native module or `app.config.ts` changes; code
150−changes reload live. With Android Studio, `APP_VARIANT=development npx expo
150+changes reload live. `.g1t/workflows/mobile-build.yml` builds it by hand
151+(Run workflow, `development`); its default, `preview`, is what testers
152+install, and main builds that again when the native side changes. The
153+run's summary links the build on expo.dev, whose QR code installs it. With Android Studio, `APP_VARIANT=development npx expo
151154 run:android` builds the same app on your computer instead (it makes
152155 `android/`, ignored by git).
153156

Comments

Sign in to comment.