Local Android releases #
Run this from a clean, committed checkout with Bun and Android Studio installed:
bun run release:android v0.1.6
The command builds the current commit in a temporary Git worktree, runs tests,
typechecking and lint, signs an ARM64 APK with the existing private release key,
pushes an annotated version tag to Tangled, and uploads the APK to its tags page.
It does not push or merge your branch. Choose a new version for each release;
the command refuses to move an existing tag. Build failures do not create tags.
The temporary build checkout is removed after the APK is copied to artifacts/.
Signing credentials are read from ~/.config/co/android-release/secrets.json.
Set CO_SIGNING_SECRETS_FILE to use a different file. This reuses the private key
and signing lineage prepared for this app; it does not create replacement keys.
Android Studio's bundled Java and ~/Library/Android/sdk are used by default;
JAVA_HOME and ANDROID_HOME can override them. SDK Build Tools 36.1.0 are required.
Publishing prompts for the AT Protocol app password with input hidden. It is not
saved or passed to the build. ATP_APP_PASSWORD may be supplied through the
environment instead. The secret configured on Tangled is not available to local
commands. No Expo account or hosted runner is needed.
To build without publishing, then upload the saved APK later:
bun run release:android v0.1.6 --build-only
bun run release:android v0.1.6 --publish-only
Both commands must run at the same commit. The saved manifest checks the version,
source commit, and APK hash; publication also verifies the APK signature. A failed
upload can be retried with --publish-only. Published artifacts stay immutable.
Outputs are artifacts/co-v0.1.6-arm64.apk, its .sha256 checksum, and a .json
build manifest. After publishing, download from
Co's tags page.
Hosted workflow (disabled) #
The old hosted workflow is retained as scripts/ci/android-release.yml.example
for a future runner with enough build time. Version tags no longer start hosted
Android builds. The following setup and run history document that earlier attempt.
Hosted setup #
In Co's pipeline settings,
select a spindle that supports the microvm engine, the nixos image, and Docker.
The first build downloads a roughly 196 MB Java image, installs the required
Android SDK packages, and compiles the native app; the runner needs sufficient
memory, disk, and time for a cold native build.
Workflow time limits are controlled by the spindle operator, not this YAML.
Co is configured on spindle.tangled.sh. Its deployed workflow parser does not
yet support the documented top-level cache setting, so this workflow omits it.
Add these repository secrets:
| Name | Value |
|---|---|
ANDROID_KEYSTORE_BASE64 |
Base64 of the private release keystore |
ANDROID_KEYSTORE_PASSWORD |
Keystore password |
ANDROID_KEY_ALIAS |
co-release |
ANDROID_KEY_PASSWORD |
Optional; defaults to the keystore password |
ANDROID_SIGNING_LINEAGE_BASE64 |
Base64 of the signing lineage, to upgrade the previous test builds |
ATP_APP_PASSWORD |
A dedicated app password for the cameron.stream AT Protocol account |
The workflow records the public account/PDS/repository identifiers. If the account
moves PDS, update ATP_PDS_URL after resolving its DID again. No password or
private key belongs in the workflow or repository. Publishing credentials are not
passed to the Android build container. Only version-tag pushes can publish;
manual dispatches and pull requests fail the publishing preflight.
The locally prepared credentials are in
~/.config/co/android-release/secrets.json, alongside release.jks and
release.lineage. The directory is private to the local user. Back these up in a
password manager or another private location before relying on releases; losing
the private signing key prevents future updates. The AT Protocol app password is
not generated by this local setup. All five required secrets, including the
separate AT Protocol app password, are configured in Tangled.
Hosted validation status #
As of September 8, 2026, the runner and all required secrets are configured, but no hosted APK has been published. The tag preflight passes; builds on the public spindle repeatedly reach its 15-minute timeout before compiling the app. The latest attempt, v0.1.5, ended after 15 minutes 6 seconds, with the final build output still unpacking Ubuntu system packages. An earlier attempt reached Android SDK installation. The observed runner has two CPUs and roughly 4 GiB of memory.
The remaining work is to establish a runner/toolchain setup that completes a cold Android build within its time budget, then verify the real PDS upload and artifact download. Options include a spindle with a longer time limit or a prebuilt build environment with working caches. Secret presence has been checked, but publishing authentication has not been exercised because no hosted build reached that step. Do not treat the workflow as a verified release path yet.
The version tag sets Expo's version name and Android version code. Codes use
major * 1,000,000 + minor * 1,000 + patch; minor and patch must each be below
1,000. v0.1.1 is version code 1001. Lightweight tags, prerelease tags, and tags
that do not point to the checked-out commit are rejected before building.
Signing and installation #
The earlier manually installed builds used Expo's public test certificate. The release key is private. Android signing lineage allows Android 9+ to upgrade from the previous certificate to the release certificate in place. Android 7–8 retain the legacy test signature for compatibility; these releases target modern phones. The private release certificate SHA-256 is:
25c80cc89bedf04b528da2620ebe90af5403f781a53a62308be096564602fa08
Verified locally: version 0.1.1 / code 1001 builds, its signature verifies, and
installing it over the test-signed 0.1.0 on the Android emulator succeeds with
adb install -r, preserving the installation. The physical phone was not connected
during this release setup. The prepared APK is about 45.7 MiB, below Tangled's
50 MiB artifact limit. The build produces a SHA-256 sidecar locally; the pipeline
publishes the APK itself.
Local validation does not prove a hosted pipeline run. A real tag build and PDS upload must succeed after the runner and secrets are configured.
Implementation #
scripts/ci/android-release.shuses a digest-pinned Eclipse Temurin JDK 17 image; Node and Android archives are checked against pinned SHA-256 hashes. SDK archives come directly from Google's repository via curl, avoiding a hostedsdkmanagerdownload stall. Gradle caches are outside the temporary signing directory.scripts/android-release.tssigns using temporary private files and environment passwords, verifies the APK, checks the size limit, and publishes the blob andsh.tangled.repo.artifactrecord withrepoDidand the annotated tag hash.- Publication verifies the account DID before uploading. Errors do not echo server responses or credentials. A failed/incomplete upload never creates an artifact record.
bun test scripts/android-release.test.tschecks versioning, tag validation, size limits, publication retries, wrong accounts, and failed uploads.
References: Tangled pipelines, current artifact schema, Android signing tools.