Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

Android release workflow: a signed APK built in CI

Claudec841d67c5e7e
diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml
new file mode 100644
index 00000000..9ee8af38
--- /dev/null
+++ b/.github/workflows/android-release.yml
@@ -0,0 +1,99 @@
+name: Android release
+
+# A signed APK of Coucou for Android, built here so a release never depends on one machine.
+#
+# - Run it by hand (Actions → Android release → Run workflow) to get the signed APK as an artifact, without publishing.
+# - Push an `android-v*` tag (for example android-v0.1.0) to publish it in a GitHub release.
+#
+# The release key lives only in two repository secrets: ANDROID_KEYSTORE_BASE64 (the .jks file, base64) and
+# ANDROID_KEYSTORE_PASSWORD. Keep a backup of the .jks and its password outside GitHub: an app signed with a lost key can never
+# be updated in place.
+on:
+ push:
+ tags:
+ - 'android-v*'
+ workflow_dispatch:
+
+permissions:
+ contents: write
+
+jobs:
+ apk:
+ runs-on: ubuntu-24.04
+ defaults: { run: { working-directory: android } }
+ steps:
+ - uses: actions/checkout@v7
+ with: { persist-credentials: false }
+ - uses: actions/setup-java@v6
+ with: { distribution: temurin, java-version: '17' }
+ - uses: actions/setup-node@v7
+ with: { node-version: '22' }
+ - uses: gradle/actions/setup-gradle@v5
+
+ - name: Version
+ id: version
+ run: |
+ v=$(sed -nE 's/^[[:space:]]*versionName = "([^"]+)".*/\1/p' app/build.gradle.kts)
+ test -n "$v" || { echo "no versionName in app/build.gradle.kts"; exit 1; }
+ echo "version=$v" >> "$GITHUB_OUTPUT"
+ if [[ "$GITHUB_REF" == refs/tags/android-v* ]]; then
+ tag="${GITHUB_REF_NAME#android-v}"
+ test "$tag" = "$v" || { echo "the tag says $tag but versionName is $v"; exit 1; }
+ fi
+
+ - name: The release key
+ env:
+ KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
+ run: |
+ test -n "$KEYSTORE_BASE64" || { echo "ANDROID_KEYSTORE_BASE64 is not set: refusing to build an unsigned release"; exit 1; }
+ echo "$KEYSTORE_BASE64" | base64 -d > "$RUNNER_TEMP/release.jks"
+
+ - name: Signed release APK
+ env:
+ COUCOU_KEYSTORE_FILE: ${{ runner.temp }}/release.jks
+ COUCOU_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
+ COUCOU_KEY_ALIAS: coucou
+ run: |
+ test -n "$COUCOU_KEYSTORE_PASSWORD" || { echo "ANDROID_KEYSTORE_PASSWORD is not set"; exit 1; }
+ node scripts/gen-strings.mjs --check
+ ./gradlew assembleRelease --console=plain
+ rm -f "$COUCOU_KEYSTORE_FILE"
+
+ - name: Check the signature
+ run: |
+ apksigner="$(ls -d "$ANDROID_HOME"/build-tools/* | sort -V | tail -1)/apksigner"
+ "$apksigner" verify --print-certs app/build/outputs/apk/release/app-release.apk
+ v="${{ steps.version.outputs.version }}"
+ mkdir -p release
+ cp app/build/outputs/apk/release/app-release.apk "release/Coucou-Android-$v.apk"
+ (cd release && sha256sum "Coucou-Android-$v.apk" > SHA256SUMS)
+
+ - uses: actions/upload-artifact@v7
+ with:
+ name: Coucou-Android-${{ steps.version.outputs.version }}
+ path: |
+ android/release/
+ android/app/build/outputs/mapping/release/mapping.txt
+
+ - name: Publish the release
+ if: startsWith(github.ref, 'refs/tags/android-v')
+ env:
+ GH_TOKEN: ${{ github.token }}
+ VERSION: ${{ steps.version.outputs.version }}
+ run: |
+ v="$VERSION"
+ notes="Coucou for Android $v, by Rhytam Biswas (@Rhytam23): your coding agents on your Android phone.
+
+ 1. Download \`Coucou-Android-$v.apk\` on your phone (Android 11 or later) and open it. Android asks once to allow installs from your browser or file manager.
+ 2. On your computer, Coucou 0.4.0 or later for Windows or Linux: Settings → Android phone, turn on Phone link, then Show pairing code.
+ 3. Scan the code with the app. The phone and the computer must be on the same Wi-Fi.
+
+ Check the download with \`sha256sum -c SHA256SUMS\`. Guide and troubleshooting: https://github.com/Louis-CFM/coucou/blob/main/android/README.md"
+ # --latest=false: the macOS v* releases own the Latest slot, which the site's Download for Mac button points at.
+ gh release create "$GITHUB_REF_NAME" \
+ "release/Coucou-Android-$v.apk" \
+ "release/SHA256SUMS" \
+ --repo "$GITHUB_REPOSITORY" \
+ --title "Coucou for Android $v" \
+ --notes "$notes" \
+ --latest=false