Files
kegel/.gitea/workflows/release.yml
marcuspaico 55999b7458
Some checks failed
Build & Release APK / build (push) Has been cancelled
feat: store release setup — EAS config, listing copy, screenshots, new icon
- eas.json production/simulator profiles; iOS plist flags; EAS project linked
- literal versionCode/versionName in build.gradle so EAS can parse it; Gitea CI
  stamps the run number with sed instead of env-driven gradle expressions
- store/: listing copy + keyword rationale, screenshot composer (headless
  Chrome), raw simulator captures, rendered App Store / Play slides, feature
  graphic, privacy policy source, icon generator
- replace Expo placeholder icon with the session-ring mark; regenerate Android
  launcher/splash res and theme colours

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WontRuPqKcod9XK4ZN9MXv
2026-09-07 16:10:27 +10:00

89 lines
3.9 KiB
YAML

name: Build & Release APK
on:
push:
branches: [main]
jobs:
build:
# RN/NDK builds starve the 4-core VPS, so `desktop` (marcusDesktop) is the
# preferred runner — but jobs queue while the desktop is off. On
# ubuntu-latest the VPS builds immediately; flip back when the desktop is
# reliably online.
runs-on: ubuntu-latest
container:
image: eclipse-temurin:21-jdk
steps:
# actions/checkout needs node, which this container lacks — clone directly
- name: Checkout
run: |
apt-get update -qq && apt-get install -y -qq git unzip curl >/dev/null
git init -q .
git fetch -q --depth 1 "https://git.rehbock.xyz/${{ github.repository }}.git" "${{ github.sha }}"
git checkout -q FETCH_HEAD
- name: Install Node.js
run: |
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - >/dev/null 2>&1
apt-get install -y -qq nodejs >/dev/null
node --version
- name: Install Android SDK
# $HOME/android-sdk is a persistent runner volume — skip when warm.
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
run: npm ci --no-audit --no-fund
- name: Decode signing keystore
env:
KEYSTORE_B64: ${{ secrets.KEYSTORE_B64 }}
run: echo "$KEYSTORE_B64" | base64 -d > /tmp/release.jks
- name: Build signed release APK
env:
KEYSTORE_FILE: /tmp/release.jks
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: kegel
VERSION_CODE: ${{ github.run_number }}
VERSION_NAME: 1.${{ github.run_number }}
run: |
export ANDROID_HOME="$HOME/android-sdk"
cd android
# build.gradle keeps literal versions so EAS (Play builds) can parse them;
# stamp the CI run number in for the Gitea/Obtainium APK.
sed -i "s/^\( *\)versionCode [0-9]*$/\1versionCode $VERSION_CODE/; s/^\( *\)versionName \".*\"$/\1versionName \"$VERSION_NAME\"/" app/build.gradle
grep -n "versionCode\|versionName" app/build.gradle
echo "sdk.dir=$ANDROID_HOME" > local.properties
./gradlew assembleRelease --no-daemon --console=plain
- name: Publish Gitea release with APK
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
API="https://git.rehbock.xyz/api/v1/repos/${{ github.repository }}"
TAG="v1.${{ github.run_number }}"
APK=android/app/build/outputs/apk/release/app-release.apk
test -f "$APK"
curl -sf -X POST "$API/releases" \
-H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"Automated build of commit ${{ github.sha }}\",\"target_commitish\":\"${{ github.sha }}\"}" \
> /tmp/release.json
RID=$(grep -o '"id":[0-9]*' /tmp/release.json | head -1 | cut -d: -f2)
echo "release id: $RID"
curl -sf -X POST "$API/releases/$RID/assets?name=kegel-$TAG.apk" \
-H "Authorization: token $TOKEN" \
-F "attachment=@$APK;type=application/vnd.android.package-archive" >/dev/null
echo "published $TAG"