summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-05-20 21:32:33 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-05-20 21:33:45 +0000
commit861e87e0724f439186ec3f693719c66bfcc47883 (patch)
tree92e16b18600ffc1c29996861008f3b4d988c96df
parent6c8ca71f3acc0686bbd351c53e4ea10a0e6e3c2d (diff)
ci: standardize workflow to canonical template, remove vestigial appdistribution plugin
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rw-r--r--.github/workflows/android.yml111
-rw-r--r--android-app/app/build.gradle3
2 files changed, 61 insertions, 53 deletions
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index 7e68aed..80b025b 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -1,68 +1,77 @@
name: Android CI/CD
+# ── Per-project config ────────────────────────────────────────
+env:
+ ANDROID_DIR: android-app
+ APP_NAME: nav
+# ─────────────────────────────────────────────────────────────
+
on:
push:
- branches: [ main, claude/** ]
+ branches: [ main, "claude/**" ]
pull_request:
branches: [ main ]
+ workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
-
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-java@v4
+ with:
+ java-version: '17'
+ distribution: temurin
+ cache: gradle
+
+ - name: Accept SDK licenses
+ run: yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null 2>&1 || true
+
+ - name: Grant gradlew permission
+ run: chmod +x ${{ env.ANDROID_DIR }}/gradlew
+
+ - name: Compute version
+ run: |
+ COMMIT_SHORT=$(git rev-parse --short HEAD)
+ COMMIT_MSG=$(git log -1 --pretty=format:'%s' | cut -c1-60)
+ VN="1.0.${{ github.run_number }} (${COMMIT_SHORT} ${COMMIT_MSG})"
+ printf '\nbuildVersionCode=${{ github.run_number }}\nbuildVersionName=%s\n' "$VN" >> ${{ env.ANDROID_DIR }}/gradle.properties
+ echo "BUILD_VERSION_NAME=${VN}" >> $GITHUB_ENV
- - name: Set up JDK 17
- uses: actions/setup-java@v4
- with:
- java-version: '17'
- distribution: 'temurin'
- cache: gradle
+ - name: Build debug APK
+ run: ./gradlew assembleDebug --no-daemon
+ working-directory: ${{ env.ANDROID_DIR }}
- - name: Grant execute permission for gradlew
- run: chmod +x android-app/gradlew
+ - name: Distribute to testers
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
+ uses: wzieba/Firebase-Distribution-Github-Action@v1
+ with:
+ appId: ${{ secrets.FIREBASE_APP_ID }}
+ serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
+ groups: testers
+ releaseNotes: ${{ env.BUILD_VERSION_NAME }}
+ file: ${{ env.ANDROID_DIR }}/app/build/outputs/apk/debug/app-debug.apk
- - name: Compute version
- run: |
- COMMIT_SHORT=$(git rev-parse --short HEAD)
- COMMIT_MSG=$(git log -1 --pretty=format:'%s' | cut -c1-60)
- VN="1.0.${{ github.run_number }} (${COMMIT_SHORT} ${COMMIT_MSG})"
- printf '\nbuildVersionCode=${{ github.run_number }}\nbuildVersionName=%s\n' "$VN" >> android-app/gradle.properties
- echo "BUILD_VERSION_NAME=${VN}" >> $GITHUB_ENV
+ - name: Upload debug artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: ${{ env.APP_NAME }}-debug
+ path: ${{ env.ANDROID_DIR }}/app/build/outputs/apk/debug/app-debug.apk
+ retention-days: 3
- - name: Build with Gradle
- run: ./gradlew assembleDebug
- working-directory: android-app
+ - name: Build release APK
+ run: ./gradlew assembleRelease --no-daemon
+ working-directory: ${{ env.ANDROID_DIR }}
- - name: upload artifact to Firebase App Distribution
- if: github.ref == 'refs/heads/main' && github.event_name == 'push'
- uses: wzieba/Firebase-Distribution-Github-Action@v1
- with:
- appId: ${{secrets.FIREBASE_APP_ID}}
- serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
- groups: testers
- releaseNotes: "${{ env.BUILD_VERSION_NAME }}"
- file: android-app/app/build/outputs/apk/debug/app-debug.apk
+ - name: Upload release artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: ${{ env.APP_NAME }}-release-unsigned
+ path: ${{ env.ANDROID_DIR }}/app/build/outputs/apk/release/app-release-unsigned.apk
+ retention-days: 3
- - name: Notify claudomator
- if: always()
- env:
- CLAUDOMATOR_WEBHOOK_URL: ${{ secrets.CLAUDOMATOR_WEBHOOK_URL }}
- CLAUDOMATOR_WEBHOOK_SECRET: ${{ secrets.CLAUDOMATOR_WEBHOOK_SECRET }}
- run: |
- PAYLOAD=$(jq -n \
- --arg action "completed" \
- --arg conclusion "${{ job.status }}" \
- --arg name "${{ github.workflow }}" \
- --arg repo "${{ github.repository }}" \
- --arg sha "${{ github.sha }}" \
- --arg run_id "${{ github.run_id }}" \
- '{action: $action, workflow_run: {conclusion: $conclusion, name: $name, head_sha: $sha, id: ($run_id | tonumber)}, repository: {full_name: $repo}}')
- SIG=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$CLAUDOMATOR_WEBHOOK_SECRET" | awk '{print $2}')
- curl -sf -X POST \
- -H "Content-Type: application/json" \
- -H "X-GitHub-Event: workflow_run" \
- -H "X-Hub-Signature-256: sha256=${SIG}" \
- "${CLAUDOMATOR_WEBHOOK_URL}/api/webhooks/github" \
- -d "$PAYLOAD"
+ # ── Claudomator ── uncomment when wired up ─────────────
+ # - name: Notify claudomator
+ # if: always()
+ # ...
diff --git a/android-app/app/build.gradle b/android-app/app/build.gradle
index 9748d22..bf8d5c9 100644
--- a/android-app/app/build.gradle
+++ b/android-app/app/build.gradle
@@ -2,8 +2,7 @@ plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.gms.google-services'
- id 'com.google.firebase.appdistribution'
- id 'com.google.firebase.crashlytics'
+id 'com.google.firebase.crashlytics'
id 'com.google.devtools.ksp'
}