Skip to content

ci: publish rolling -SNAPSHOT build of main to a GitHub prerelease#6160

Merged
jamesarich merged 2 commits into
mainfrom
claude/nightly-release-main-8a41cc
Jul 8, 2026
Merged

ci: publish rolling -SNAPSHOT build of main to a GitHub prerelease#6160
jamesarich merged 2 commits into
mainfrom
claude/nightly-release-main-8a41cc

Conversation

@jamesarich

@jamesarich jamesarich commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Why

There's currently no easy way to grab a build of the very latest main — testers have to dig through Actions artifacts, which require a GitHub login and expire after 7 days. This adds a rolling snapshot prerelease that tracks main and gives testers (and Obtainium) a stable download link, at essentially zero extra CI cost since it reuses the debug APKs the pipeline already builds.

Changes

🌟 New Features

  • Rolling snapshot prerelease. New publish-snapshot job in main-check.yml runs on every push to main, republishing the existing debug APKs as a GitHub prerelease under the moving snapshot tag. No new build steps, no new secrets, no Play/Firebase channel.
  • -SNAPSHOT versionName stamped on main-branch builds only (reusable-check.yml); PR and merge-queue builds keep the plain base version.

🛠️ Architecture / mechanics

  • APK filenames embed the monotonic versionCode (…-debug-<versionCode>.apk). A moving tag reuses the same asset URL forever, and Obtainium fingerprints that URL — so without a changing filename it would never detect a new build.
  • The job delete+recreates the release and tag at HEAD rather than updating in place. This prunes stale, differently-named assets (which would otherwise accumulate) and sidesteps the Releases API refusing to retarget an already-existing tag.
  • Uses CROWDIN_GITHUB_TOKEN for the tag delete/create — the same token every other tag-touching workflow uses, since the default GITHUB_TOKEN is blocked by the repo's tag rulesets.

🧹 Chores (docs)

  • obtainium-test-builds.md: documented the new snapshot channel — notably it installs as a separate .debug package, so the uninstall-the-Play-version dance doesn't apply. Also fixed the "bleeding edge" instructions, which would otherwise now follow snapshot (always the newest prerelease) instead of the newest open/closed beta.

Reviewer notes

  • Nothing else is triggered by the tag. docs-release.yml only fires on v*.*.* (snapshot doesn't match), and the real release pipeline is workflow_dispatch/workflow_call only.
  • The exact split-APK filenames in the Obtainium doc (androidApp-google-arm64-v8a-debug-<vc>.apk) are derived from the build config; the first real snapshot run is the cheap way to confirm the documented regexes match.
  • Design intentionally stayed with GitHub Releases + debug signing (per discussion) rather than Firebase App Distribution / a dedicated nightly key / a separate applicationId — the .debug suffix already isolates snapshot installs from production.

Testing Performed

Workflow-only change; validated both YAML files parse. Full behavior is exercised by the first push to main after merge (build → rename → delete/recreate release).

Summary by CodeRabbit

  • New Features

    • Added automated snapshot releases for Android debug APKs, simplifying installation of the latest test builds.
    • Push builds are now marked with a distinct “SNAPSHOT” version label to clearly separate them from promoted builds.
  • Documentation

    • Updated Obtainium channel guidance to include a snapshot channel and explain snapshot-specific behavior.
    • Expanded “Bleeding edge” and “Snapshot” setup instructions with improved filtering and notes about debug-only artifacts.

Every push to main now republishes the debug APKs the CI already builds as
a rolling `snapshot` prerelease, giving testers a stable download link
instead of expiring, login-gated Actions artifacts.

- reusable-check: stamp VERSION_NAME=<base>-SNAPSHOT on main pushes only
  (PR/merge-queue builds keep the plain base version).
- main-check: new publish-snapshot job. Reuses the existing debug APKs,
  embeds the monotonic versionCode in each filename (so Obtainium's
  asset-URL fingerprint sees a new build; a static moving-tag URL never
  changes on its own), then delete+recreates the `snapshot` release and
  tag at HEAD. The recreate prunes stale differently-named assets and
  sidesteps the Releases API refusing to retarget an existing tag.
- Uses CROWDIN_GITHUB_TOKEN for the tag delete/create, matching every
  other tag-touching workflow (default GITHUB_TOKEN is blocked by tag
  rulesets).
- obtainium-test-builds: document the snapshot channel (installs as a
  separate `.debug` package, so no uninstall dance) and fix the "bleeding
  edge" filter, which would otherwise now follow snapshot instead of the
  newest open/closed beta.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0946bb1f-b50b-4993-8b2d-f50a12ac056e

📥 Commits

Reviewing files that changed from the base of the PR and between e8cef93 and e142007.

📒 Files selected for processing (1)
  • .github/workflows/main-check.yml

📝 Walkthrough

Walkthrough

This PR adds snapshot release automation for debug APKs, tags push builds with a -SNAPSHOT version suffix, and updates Obtainium documentation for the new snapshot channel and filtering rules.

Changes

Snapshot Release Automation

Layer / File(s) Summary
Snapshot version tagging
.github/workflows/reusable-check.yml
Adds a step that derives VERSION_NAME with a -SNAPSHOT suffix from VERSION_NAME_BASE for push-triggered builds only.
Publish-snapshot job and release publishing
.github/workflows/main-check.yml
Adds a repository-gated publish-snapshot job that checks out with full history, downloads app-debug-apks, computes a VERSION_CODE, renames APKs, deletes any prior snapshot release/tag, and publishes a new prerelease with the renamed assets.
Obtainium snapshot channel documentation
obtainium-test-builds.md
Adds a snapshot row and explanation to the channel table, reworks bleeding-edge guidance with a required release-title filter, and adds regex filters for selecting snapshot debug APKs by flavor/ABI.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant ArtifactStore
  participant GH_CLI
  participant GitHubReleases

  GitHubActions->>ArtifactStore: Download app-debug-apks artifact
  GitHubActions->>GitHubActions: Compute VERSION_CODE and rename APKs
  GitHubActions->>GH_CLI: Delete existing snapshot release
  GitHubActions->>GitHubReleases: Create snapshot prerelease with renamed APKs
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: publishing rolling main-branch -SNAPSHOT builds as a GitHub prerelease.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/nightly-release-main-8a41cc

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added ci Pertains to ci/cd actions or workflows repo Repository maintenance labels Jul 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/main-check.yml (1)

76-90: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider replacing action-gh-release with gh release create.

zizmor flags this as redundant since gh (already used for the delete step) provides the same release-creation functionality natively on the runner, avoiding an extra third-party action dependency.

♻️ Proposed refactor
-      - name: Publish snapshot release
-        uses: softprops/action-gh-release@v3
-        with:
-          token: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
-          tag_name: snapshot
-          name: Snapshot ${{ env.VERSION_CODE }} (${{ github.sha }})
-          target_commitish: ${{ github.sha }}
-          body: |
-            Automated debug build from the latest commit on `main` (${{ github.sha }}), versionCode ${{ env.VERSION_CODE }}.
-            Unsigned/debug-keyed, F-Droid and Google flavors. Not for production use — this release is replaced on every push to main.
-
-            **Obtainium:** enable *Include prereleases*. Each build's APK filename carries the versionCode, so updates are detected.
-          files: upload/*.apk
-          prerelease: true
-          generate_release_notes: false
+      - name: Publish snapshot release
+        run: |
+          gh release create snapshot upload/*.apk \
+            --title "Snapshot ${VERSION_CODE} (${GITHUB_SHA})" \
+            --target "${GITHUB_SHA}" \
+            --prerelease \
+            --notes "Automated debug build from the latest commit on \`main\` (${GITHUB_SHA}), versionCode ${VERSION_CODE}."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/main-check.yml around lines 76 - 90, Replace the Snapshot
release publishing step in the main-check workflow by using the built-in gh
release create command instead of softprops/action-gh-release. Rework the
publish snapshot release job to create/update the snapshot tag with gh,
preserving the same tag_name, name, target_commitish, body, prerelease behavior,
and upload/*.apk attachment handling while removing the third-party action
dependency.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/main-check.yml:
- Around line 43-47: The Checkout code step in the main-check workflow is
persisting the CROWDIN_GITHUB_TOKEN in git config; update the actions/checkout
invocation to disable credential persistence by setting persist-credentials to
false. Keep the existing token and fetch-depth settings, and make the change
directly in the checkout step so later steps like download-artifact, shell
commands, and gh usage do not inherit unnecessary git credentials.

---

Nitpick comments:
In @.github/workflows/main-check.yml:
- Around line 76-90: Replace the Snapshot release publishing step in the
main-check workflow by using the built-in gh release create command instead of
softprops/action-gh-release. Rework the publish snapshot release job to
create/update the snapshot tag with gh, preserving the same tag_name, name,
target_commitish, body, prerelease behavior, and upload/*.apk attachment
handling while removing the third-party action dependency.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c92eaff7-6483-4c78-ae15-782761ba7940

📥 Commits

Reviewing files that changed from the base of the PR and between f4a71a4 and e8cef93.

📒 Files selected for processing (3)
  • .github/workflows/main-check.yml
  • .github/workflows/reusable-check.yml
  • obtainium-test-builds.md

Comment thread .github/workflows/main-check.yml
- persist-credentials: false on checkout (token isn't needed by later
  steps; gh does the authed work via GH_TOKEN). Fixes zizmor artipacked.
- Replace softprops/action-gh-release with the runner's built-in
  gh release create, dropping a third-party action already duplicated by
  the gh-based delete step.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jamesarich
jamesarich enabled auto-merge July 8, 2026 20:05
@jamesarich
jamesarich added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit 4915dac Jul 8, 2026
17 checks passed
@jamesarich
jamesarich deleted the claude/nightly-release-main-8a41cc branch July 8, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pertains to ci/cd actions or workflows repo Repository maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant