Repository navigation
ci(android): automate GitHub Release on semantic version tags - #21
Merged
Merged
Conversation
Adds a dedicated `release` job to .github/workflows/android-apk.yml that:
- triggers only on pushes of semantic version tags vMAJOR.MINOR.PATCH
(branches and PRs continue running only checks/debug-apk/release-apk
as before; release job is skipped)
- depends on checks + release-apk — a release is NEVER published if
tests fail or the production APK fails to build
- requires contents: write only on the release job; other jobs keep
the default read-only permissions
- downloads the existing dsmnru-pyq.apk Actions artifact (the APK is
NOT rebuilt a second time; the artifact ZIP is NOT attached)
- validates tag format strictly (rejects v1, v1.4, v1.4.3-beta, etc.)
- cross-checks Gradle versionName against the tag version (mismatch
fails the release; developer must bump intentionally)
- re-verifies the downloaded APK with apksigner/aapt:
package = com.dsmnru.pyq
versionName = tag version
versionCode = Gradle versionCode
APK is signed (apksigner verify --print-certs)
- fails loudly if signing secrets are missing on a tag push (instead
of silently producing an unsigned release)
- generates a release body that ALWAYS contains the required
'versionCode: N' line (parsed by Worker /api/app-update) plus
GitHub-generated changelog notes
- creates the release idempotently: reruns detect an existing
release, ensure the body has versionCode, and avoid duplicate
APK assets (re-uploads only if sizes differ)
- uses github.token (GITHUB_TOKEN); no PAT is introduced
- never echoes keystore contents, passwords, or base64 secrets to
logs.
Also adds android-app/test/release-automation.test.mjs covering
tag validation, Gradle/APK metadata parsing, the release-body
versionCode contract, asset selection compatibility with the
existing Worker parser, and workflow-file invariants (tag trigger,
needs chain, least-privilege permissions, download-artifact use,
gh CLI usage, no secret echo).
Existing jobs (checks, debug-apk, release-apk), existing tests,
Firebase secret handling, production signing secret handling,
Capacitor sync, APK verification and artifact naming are preserved.
versionName 1.4.2 / versionCode 13 are NOT bumped; no tags or
releases are created by this change.
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the current manual production release process (download artifact ZIP → extract APK → manually create Release → upload APK) with a fully automated tag-driven pipeline:
What this PR does
releasejob to.github/workflows/android-apk.ymlthat:vMAJOR.MINOR.PATCH(e.g. v1.4.3, v1.5.0, v2.0.0)needs:checks and release-apk — a release can NEVER be created if tests fail or the production APK fails to buildpermissions: contents: write(other jobs keep the default read-only)dsmnru-pyq.apkartifact (the APK is not rebuilt; the artifact ZIP is not attached)v1,v1.4,1.4.3,v1.4.3-beta, arbitrary tags)versionNameagainst the tag version (mismatch fails; developer must bump intentionally)apksigner verify --print-certsandaapt dump badging:com.dsmnru.pyqversionCode: N(required by Worker/api/app-update) plus GitHub-generated changelog notesversionCode, and avoid duplicate APK assetsGITHUB_TOKEN(no PAT introduced)android-app/test/release-automation.test.mjs(13 tests) covering tag validation, Gradle/APK metadata parsing, theversionCode: Nbody contract, compatibility withworker/src/appUpdate.jsasset selection, and workflow-file invariants.What this PR does NOT do
/api/app-updatecontract — the release body still contains the requiredversionCode: Nline, now generated automatically from the APKPreserved
checks,debug-apk,release-apkapksignerdsmnru-pyq.apk,dsmnru-pyq-debug-apk)Release flow (after merge)
versionNameandversionCodeinandroid-app/android/app/build.gradleand merges toandroid-app.git tag v1.4.3 && git push origin v1.4.3.checks+release-apk→ builds signed APK, verifies signature/package/version.releasejob:DSMNRU PYQ v1.4.3withdsmnru-pyq.apkas a direct asset and a body containingversionCode: N.Tests