- actions/setup-node cache: npm - actions/cache for ~/.gradle/caches, ~/.gradle/wrapper, android/.gradle - actions/cache for Android intermediates (android/app/build/intermediates, android/build, android/app/.cxx) - Skip debug keystore regeneration if cached - Add workflow_dispatch to publish-play-store for manual re-runs Cuts a clean run from ~6m to ~2-3m once warm. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
88 lines
2.6 KiB
YAML
88 lines
2.6 KiB
YAML
name: Publish to Google Play Store
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
push:
|
|
tags: ["v*"]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
EXPO_PUBLIC_SENTRY_DSN: ${{ secrets.EXPO_PUBLIC_SENTRY_DSN }}
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
|
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: 17
|
|
|
|
- name: Setup Android SDK
|
|
uses: android-actions/setup-android@v3
|
|
|
|
- name: Cache Gradle
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
android/.gradle
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('android/**/*.gradle*', 'android/gradle/wrapper/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Cache Android build outputs
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
android/app/build/intermediates
|
|
android/build
|
|
android/app/.cxx
|
|
key: ${{ runner.os }}-android-build-${{ hashFiles('package-lock.json', 'android/**/*.gradle*') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-android-build-
|
|
|
|
- name: Install dependencies
|
|
run: npm install --legacy-peer-deps
|
|
|
|
- name: Expo prebuild
|
|
run: npx expo prebuild --platform android --no-install
|
|
|
|
- name: Decode keystore
|
|
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/app/release.keystore
|
|
|
|
- name: Build AAB
|
|
working-directory: android
|
|
env:
|
|
RELEASE_STORE_FILE: release.keystore
|
|
RELEASE_STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
|
RELEASE_KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
|
RELEASE_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
|
run: ./gradlew bundleRelease
|
|
|
|
- name: Upload AAB artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: app-release-bundle
|
|
path: android/app/build/outputs/bundle/release/app-release.aab
|
|
|
|
- name: Publish to Play Store
|
|
uses: r0adkll/upload-google-play@v1
|
|
with:
|
|
serviceAccountJsonPlainText: ${{ secrets.PLAY_STORE_SERVICE_ACCOUNT_JSON }}
|
|
packageName: ai.opencode.mobile
|
|
releaseFiles: android/app/build/outputs/bundle/release/app-release.aab
|
|
track: internal
|
|
status: completed
|