ci: run check + APK build natively on the MacBook runner
Some checks failed
Build & Release APK / check (push) Has been cancelled
Build & Release APK / build (push) Has been cancelled

The desktop runner is gone. Jobs now target label "macbook": a
gitea-runner in host mode on the MacBook Air using Homebrew JDK 21,
the local Android SDK and node 22, so no container or SDK download.
eas.json bumped to 1.22 to match the locally built release.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wmf3K9nCoEsXvvwkmMnuiM
This commit is contained in:
marcuspaico
2026-09-05 17:44:25 +10:00
parent 18a66aba58
commit 26922af997
3 changed files with 26 additions and 36 deletions

View File

@@ -8,17 +8,17 @@ jobs:
check: check:
# Fast fail: lockfile sync, types, lint — catches in ~2 min what would # Fast fail: lockfile sync, types, lint — catches in ~2 min what would
# otherwise kill the APK build twenty minutes in. # otherwise kill the APK build twenty minutes in.
runs-on: desktop runs-on: macbook
container:
image: node:22
steps: steps:
- name: Checkout - name: Checkout
run: | run: |
git init -q . git init -q .
git fetch -q --depth 1 "https://git.rehbock.xyz/${{ github.repository }}.git" "${{ github.sha }}" git fetch -q --depth 1 "https://git.rehbock.xyz/${{ github.repository }}.git" "${{ github.sha }}"
git checkout -q FETCH_HEAD git checkout -q -f FETCH_HEAD
git clean -qfd
- name: Lockfile + typecheck + lint - name: Lockfile + typecheck + lint
run: | run: |
export PATH="$HOME/.hermes/node/bin:$PATH"
cd app cd app
npm ci --no-audit --no-fund npm ci --no-audit --no-fund
npx tsc --noEmit npx tsc --noEmit
@@ -35,49 +35,38 @@ jobs:
build: build:
needs: check needs: check
# RN/NDK builds starve the 4-core VPS — run on the desktop runner # Runs natively on the MacBook Air (gitea-runner in host mode, label
# (marcusDesktop). Jobs queue while the desktop is off and start when it # "macbook"): Java 21 from Homebrew, the Android SDK from Android Studio,
# comes online; switch back to ubuntu-latest to build on the VPS. # node 22 from ~/.hermes. No container, no SDK download.
runs-on: desktop runs-on: macbook
container: env:
image: eclipse-temurin:21-jdk ANDROID_HOME: /Users/marcus/Library/Android/sdk
JAVA_HOME: /opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home
steps: steps:
# actions/checkout needs node, which this container lacks — clone directly
- name: Checkout - name: Checkout
run: | run: |
apt-get update -qq && apt-get install -y -qq git unzip curl >/dev/null
git init -q . git init -q .
git fetch -q --depth 1 "https://git.rehbock.xyz/${{ github.repository }}.git" "${{ github.sha }}" git fetch -q --depth 1 "https://git.rehbock.xyz/${{ github.repository }}.git" "${{ github.sha }}"
git checkout -q FETCH_HEAD git checkout -q -f FETCH_HEAD
git clean -qfd
- name: Install Node.js - name: Toolchain
run: | run: |
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - >/dev/null 2>&1 export PATH="$HOME/.hermes/node/bin:$PATH"
apt-get install -y -qq nodejs >/dev/null
node --version node --version
"$JAVA_HOME/bin/java" -version
- name: Install Android SDK test -d "$ANDROID_HOME/platforms/android-36"
# $HOME/android-sdk is a persistent runner volume — skip when warm. test -d "$ANDROID_HOME/build-tools/36.0.0"
run: |
if [ ! -d "$HOME/android-sdk/platforms/android-36" ]; then
mkdir -p "$HOME/android-sdk/cmdline-tools"
curl -sLo /tmp/ct.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip -q /tmp/ct.zip -d /tmp
mv /tmp/cmdline-tools "$HOME/android-sdk/cmdline-tools/latest"
yes | "$HOME/android-sdk/cmdline-tools/latest/bin/sdkmanager" --sdk_root="$HOME/android-sdk" --licenses >/dev/null 2>&1 || true
"$HOME/android-sdk/cmdline-tools/latest/bin/sdkmanager" --sdk_root="$HOME/android-sdk" \
"platform-tools" "platforms;android-36" "build-tools;36.0.0" >/dev/null
else
echo "SDK cache warm — skipping install"
fi
- name: Install app dependencies - name: Install app dependencies
run: cd app && npm ci --no-audit --no-fund run: |
export PATH="$HOME/.hermes/node/bin:$PATH"
cd app && npm ci --no-audit --no-fund
- name: Decode signing keystore - name: Decode signing keystore
env: env:
KEYSTORE_B64: ${{ secrets.KEYSTORE_B64 }} KEYSTORE_B64: ${{ secrets.KEYSTORE_B64 }}
run: echo "$KEYSTORE_B64" | base64 -d > /tmp/release.jks run: echo "$KEYSTORE_B64" | base64 --decode > /tmp/release.jks
- name: Build signed release APK - name: Build signed release APK
env: env:
@@ -90,7 +79,7 @@ jobs:
VERSION_CODE: ${{ github.run_number }} VERSION_CODE: ${{ github.run_number }}
VERSION_NAME: 1.${{ github.run_number }} VERSION_NAME: 1.${{ github.run_number }}
run: | run: |
export ANDROID_HOME="$HOME/android-sdk" export PATH="$HOME/.hermes/node/bin:$PATH"
cd app/android cd app/android
echo "sdk.dir=$ANDROID_HOME" > local.properties echo "sdk.dir=$ANDROID_HOME" > local.properties
./gradlew assembleRelease --no-daemon --console=plain ./gradlew assembleRelease --no-daemon --console=plain

1
app/.gitignore vendored
View File

@@ -40,3 +40,4 @@ example
# generated native folders (android/ is committed — CI builds it) # generated native folders (android/ is committed — CI builds it)
/ios /ios
*.apk

View File

@@ -9,8 +9,8 @@
"buildType": "apk" "buildType": "apk"
}, },
"env": { "env": {
"VERSION_CODE": "18", "VERSION_CODE": "22",
"VERSION_NAME": "1.18" "VERSION_NAME": "1.22"
}, },
"node": "22.20.0" "node": "22.20.0"
} }