Skip to content
74 linesCodeBlameRaw
1# Releases the phone app for Android (apps/mobile) on g1t.sh/download,
2# while it is not in Google Play: EAS builds the `preview` profile (g1t
3# (beta), a signed release APK), and the APK is published to
4# g1t.sh/downloads/mobile/ (the g1t-downloads R2 bucket), with latest.json
5# pointed at it. Google Play and the App Store wait on Flagon's D-U-N-S
6# number; until then this is how the app is given out.
7#
8# A release is a tag `mobile-v<version>`, where the version is the one in
9# apps/mobile/app.config.ts; or run it by hand, optionally naming a build
10# EAS already made. scripts/mobile-release.mjs does the work.
11#
12# Most changes reach installed apps without a release: `eas update
13# --channel preview` (expo-updates). A release is for a change to the
14# app's native side (a new module, app.config.ts) or its version.
15#
16# Needs the repository secret EXPO_TOKEN (an Expo access token with access
17# to the g1t project), CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID as the
18# deploy has them.
19name: Mobile release
20
21on:
22 push:
23 tags: ["mobile-v*"]
24 workflow_dispatch:
25 inputs:
26 build:
27 description: "An EAS build id to publish instead of building again"
28 type: string
29 notes:
30 description: "A line about the release, shown in the manifest"
31 type: string
32
33permissions:
34 contents: read
35
36concurrency:
37 group: mobile-release
38 cancel-in-progress: false
39
40env:
41 CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
42 WRANGLER_SEND_METRICS: "false"
43
44jobs:
45 release:
46 name: Build and publish to g1t.sh/downloads/mobile
47 runs-on: ubuntu-latest
48 environment: production
49 timeout-minutes: 60
50 steps:
51 - uses: actions/checkout@v5
52 - name: The tag names this version
53 run: |
54 version="$(sed -n 's/^\s*version: "\(.*\)",/\1/p' apps/mobile/app.config.ts | head -1)"
55 if [ "${GITHUB_REF_TYPE}" = tag ] && [ "mobile-v$version" != "${GITHUB_REF_NAME}" ]; then
56 echo "::error::The tag is ${GITHUB_REF_NAME}, but apps/mobile is $version"; exit 1
57 fi
58 - name: Install Wrangler
59 run: npm ci --workspaces=false --no-audit --no-fund
60 - name: Build on EAS
61 if: ${{ !inputs.build }}
62 env:
63 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
64 run: node scripts/mobile-release.mjs build
65 - name: Fetch the APK
66 env:
67 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
68 run: node scripts/mobile-release.mjs fetch ${{ inputs.build && format('--build {0}', inputs.build) || '' }}
69 - name: The manifest
70 run: node scripts/mobile-release.mjs manifest --notes "${{ inputs.notes }}"
71 - name: Publish
72 env:
73 CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
74 run: node scripts/mobile-release.mjs publish