Add semantic releasing pipeline #1
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
utilities/Frameify#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a semantic releasing action, with changelog, version, triggered android build, forgejo release, commit tag and in-build version number.
Implementation plan
Using the runners now live in
forgejo-runners(semantic-releaseonnode:20-slim,android-builderoncimg/android:2024.01). Two decoupled workflows, chained by a git tag rather than a direct job dependency, so the version-bump commit doesn't need to fight CI-skip semantics.1. Versioning source of truth
app/build.gradle.ktscurrently hardcodesversionCode = 1/versionName = "1.0". Move these into a small properties file so semantic-release never has to parse Kotlin DSL:version.properties(new, repo root)app/build.gradle.kts— read it indefaultConfig:versionCodemust be a monotonically increasing integer, so it's derived from semver rather than copied as a string:(valid while minor/patch stay under 1000 — fine for this app's scale; revisit if that ever changes).
2. semantic-release config
package.json(new, repo root).releaserc.json@semantic-release/giteatalks to Forgejo's Gitea-compatible release API — it creates the git tag, the Forgejo release, and attaches the generated changelog as release notes. No GitHub plugin needed.scripts/bump-version.js— small helper called by the exec plugin'sprepareCmd, writesversion.propertieswith the new semver plus the derived integerversionCode(using the formula above), so the bump logic lives in one reviewable place instead of an inline shell one-liner.3. Workflow: release (
.forgejo/workflows/release.yml)RELEASE_TOKENis a repo (or org) Actions secret: a Forgejo API token scoped towrite:repositoryonutilities/Frameify, used both to push the version-bump commit and to create the release/tag.Since
@semantic-release/git's commit message ends in[skip ci], and this workflow only triggers on branch pushes, the bump commit re-triggeringrelease.ymlis the main loop risk to watch in testing — Forgejo Actions' skip-ci handling should be verified with a--dry-runfirst (step 6).4. Workflow: Android build + release asset (
.forgejo/workflows/android-build.yml)Triggered by the tag
@semantic-release/giteapushes, not by the release workflow directly — this keeps the two jobs decoupled and avoids needingpush: branchesandpush: tagsto interact:Forgejo has no first-party "upload release asset" action, so this uses the REST API directly with
curl/jq(both present incimg/android).5. Signing — explicitly deferred
assembleReleasecurrently has minification disabled and no signing config, so this produces an unsigned release APK. Deliberately out of scope for this issue: wiring a keystore via secrets is a separate concern with its own security review (keystore storage, signing-secret rotation). Tracked as a natural follow-up issue rather than folded in here.6. Rollout steps
RELEASE_TOKENas a repo Actions secret (Settings → Actions → Secrets).version.properties, thebuild.gradle.ktschange,package.json,.releaserc.json,scripts/bump-version.json a feature branch.npx semantic-release --dry-runagainst that branch to confirm the version bump and changelog generation resolve correctly before wiring the workflow..forgejo/workflows/release.yml, merge tomain, confirm a conventional-commit-worthy change triggers a real release + tag..forgejo/workflows/android-build.yml, confirm the resulting tag push builds and attaches the APK to the release created in step 4.[skip ci]re-trigger risk noted in §3; add an explicitif: !contains(...)guard on thereleasejob if Forgejo Actions doesn't honor it natively.Deviations from the original ask (kept within "requirements survive")
@semantic-release/gitea.workflow_run-equivalent support.version.propertiesread intobuild.gradle.kts, withversionCodederived deterministically from semver rather than hand-maintained.