Build: Add CI-driven release pipeline (release-prepare)#126
Merged
Conversation
Replace the local interactive release.sh with a GitHub Actions release flow ported from d4rken-org/capod. - tools/release/bump.sh: non-interactive version bumper (check/plan/write modes) with validation, monotonic versionCode and post-write checks; single source of truth, runnable locally too. - release-prepare.yml: workflow_dispatch with dry-run preview, then GitHub-App-token commit+tag+atomic-push to main, which re-triggers release-tag.yml. - release-tag.yml: add validate-tag gate (rc-only format + version.properties<->tag match, skipped on branch dry-runs), concurrency, fail_on_unmatched_files; bump softprops to v3.0.0; drop unreachable beta steps. rc-only by design: version.properties keeps 4 keys and ProjectConfig.kt is untouched.
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.
What
Ports the CI-driven release pipeline from d4rken-org/capod so releases can be cut and versions bumped entirely from the GitHub Actions UI, replacing the local interactive
release.sh.How it works
Release prepare(workflow_dispatch) frommain. Inputs:bump_kind:build/patch/minor/major(default patch)version_override: explicitM.m.p-rcN(overridesbump_kind)expected_current: optional safety guard (fail if current version differs)dry_run: default true — computes + validates + prints the plan to the run summary, no mutationdry_run=false, job 2 mints a GitHub App token, applies the bump viabump.sh --mode=write, commitsRelease: <name>, tagsv<name>, and atomically pushes commit+tag tomain.GITHUB_TOKEN) re-triggersrelease-tag.yml, which validates the tag, builds the signed FOSS APK, and publishes the GitHub release.Changes
tools/release/bump.sh(new, executable): non-interactive version bumper, modescheck/plan/write. Validatesversion.properties↔VERSIONconsistency, enforces 0–99 bounds + no leading zeros, monotonicversionCode, and re-verifies after writing. Mirrors the formula inbuildSrc/.../ProjectConfig.kt. Runnable locally..github/workflows/release-prepare.yml(new): the two-job dispatch flow above,concurrency: release-prepare-main..github/workflows/release-tag.yml(modified): addedvalidate-taggate (rc-only tag format +version.properties↔tag match, skipped on branch dry-runs so build-only dry-runs still work),concurrency,fail_on_unmatched_files: true; bumpedsoftprops/action-gh-releaseto v3.0.0 (Node24-compatible); removed the unreachable-betabuild/prerelease steps.version.properties: header comment updated to referencetools/release/bump.sh.release.sh: deleted (replaced bybump.sh).Design decisions
version.propertieskeeps its 4 keys andProjectConfig.kt(which hardcodes-rc) is left untouched. capod'stype/beta-channel switching was intentionally dropped. Legacy-beta0/-beta1tags in history are intentionally unsupported by the new workflow.bump_kind=patch(not capod'sbuild) to match this repo's actual release cadence (all prior releases are-rc0). Override per-run as needed.RELEASE_APP_CLIENT_IDandRELEASE_APP_PRIVATE_KEYfor a GitHub App installed on this repo withcontents: write(the same App used by capod can be installed here).mainhas branch protection, the App must be allowed to bypass it, or the atomic push will be rejected.foss-productionenvironment / signing secrets (SIGNING_KEYSTORE_BASE64,STORE_PASSWORD,KEY_ALIAS,KEY_PASSWORD) are unchanged.Recovery path (tag pushed but build/release failed)
The model is monotonic and cheap to re-cut. If
release-tag.ymlfails after the tag exists:Release prepareagain), orgit push origin :refs/tags/v<name>) and revert theRelease:commit onmain, then re-run.No second release is silently published:
expected_current+ tag-collision checks +validate-tagguard against drift.Testing
bash -n tools/release/bump.sh; YAML of both workflows parses clean.checkon the real tree →0.8.0-rc0/800000;planfor build/patch/minor/major + override; beta/garbage overrides rejected;expected-currentmatch/mismatch; no-op rejected;writeagainst a temp-copied repo root (never the real tree) producing0.8.1-rc0 801000+ header refresh + clean re-validation; real tree confirmed unchanged.