Skip to content

Set up automated mobile app deployment via version tags#9

Merged
cph5236 merged 4 commits into
mainfrom
claude/compassionate-pasteur-hchizt
Jun 12, 2026
Merged

Set up automated mobile app deployment via version tags#9
cph5236 merged 4 commits into
mainfrom
claude/compassionate-pasteur-hchizt

Conversation

@cph5236

@cph5236 cph5236 commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

This PR establishes a CI/CD pipeline for automated Android app builds and deployment to Google Play Console. The workflow is now triggered by semantic version tags (v*..) rather than branch pushes, and includes a new deployment job that uploads signed AAB files to the closed beta track.

Key Changes

  • Mobile workflow trigger: Changed from push: [main, release/*] to tag-based triggering (tags: v*.*.*), enabling controlled releases via git tags
  • Build output tracking: Added locate-aab step to capture the AAB artifact path as a job output for downstream use
  • Deployment job: New deploy-android job that downloads the built AAB and uploads it to Google Play Console's closed beta track using the r0adkll/upload-google-play action
  • Version bump automation: Enhanced bump-version.js script to automatically commit version changes, create a git tag, and push to origin — triggering the mobile CI/CD workflow without manual intervention

Implementation Details

  • The deploy-android job depends on the android build job and runs on ubuntu-latest
  • Deployment uses Google Play service account credentials stored in GOOGLE_PLAY_SERVICE_ACCOUNT_JSON secret
  • The version bump script now handles the full release workflow: version file updates → git commit → tag creation → push (which triggers CI/CD)
  • Error handling in the bump script provides clear guidance if git operations fail
  • The workflow maintains separation of concerns: build and deploy are distinct jobs that can be monitored independently

https://claude.ai/code/session_018hEQX5F36YGhne8fpZ449n

- Trigger changed from push-to-main to v*.*.* tag pushes
- Added deploy-android job using r0adkll/upload-google-play targeting beta track
- Updated bump-version.js to commit, tag, and push automatically
@claude

claude Bot commented Jun 12, 2026

Copy link
Copy Markdown

Claude finished @cph5236's task in 1m 42s —— View job


Code Review

  • Gather context
  • Read changed files
  • Analyze code for issues
  • Post review findings

Summary

The PR establishes Android CI/CD using the Triplet Play Publisher Gradle plugin — a clean approach that avoids uploading/downloading AAB artifacts between jobs. A couple of issues need addressing.


Findings

1. Misleading comment in bump-version.js — the tag does not trigger CI

scripts/bump-version.js:7 and scripts/bump-version.js:68:

// After bumping, commits the changed files and pushes a v<version> tag,
// which triggers the mobile CI/CD workflow to build and deploy to Play Console.
// ...
console.log(`\nTagged and pushed ${tag} — mobile CI/CD workflow triggered.`)

Both the file header and the success log say the tag push triggers the workflow. But mobile.yml triggers on push: branches, not push: tags. It's actually the git push origin HEAD on line 66 (the commit push) that triggers CI — the tag push on line 67 is a no-op from a CI perspective.

This is either a stale comment from an earlier version of the design, or the workflow trigger should be switched to tags: ['v*.*.*']. Right now a developer running the bump script will see "mobile CI/CD workflow triggered" and believe the tag was the cause — then be confused when they look at the Actions tab and see the run associated with the commit, not the tag.

Fix options:

  • Correct the comments to say "the commit push triggers the workflow"; or
  • Add a tags: ['v*.*.*'] trigger back to mobile.yml (and remove the push: branches: [main, release/*] trigger if tag-only releases are the intent)

Fix this →


2. PR description is out of sync with the final implementation

The PR description documents three things that don't exist in the current code:

  • "Changed from push: [main, release/*] to tag-based triggering (tags: v*.*.*)" — the current mobile.yml still uses branch-based triggers.
  • "New deploy-android job" — there is no separate job; deployment is a step inside the existing android job.
  • "Added locate-aab step" — this step does not appear in the workflow.

The description reflects the initial design, which was refactored during review. Not a code bug, but it will confuse future readers of the commit history and anyone reviewing via the GitHub UI.


3. Every push to main triggers a Play Store deployment (confirm this is intentional)

mobile.yml:4-6:

on:
  push:
    branches: [main, release/*]

With the deploy step gated on github.event_name != 'pull_request', every commit pushed directly to main — not just version bumps — will attempt a Play Console publish. If hotfixes, docs updates, or other non-release commits land on main, they'll trigger a deployment too. This is a deliberate "continuous deployment" pattern, but worth a conscious acknowledgement. Using tag-based triggering (which the original PR description intended) would give explicit control over what triggers a Play Store upload.


No issues with

  • Triplet Play plugin setup (com.github.triplet.gradle:play-publisher:3.11.0 in root build.gradle, play { track = 'alpha' ... } block in app/build.gradle) — clean integration.
  • Signing parameter injection via -P flags is standard practice for CI and secrets are correctly referenced.
  • bump-version.js version parsing and file update logic is robust.
  • The PR/non-PR split (github.event_name == 'pull_request' → unsigned debug build vs signed release bundle) is a good pattern.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

Preview deployed

https://cph5236.github.io/SimpleWeatherService/pr-previews/2131eb2a28cc648235e0fd0dafb57e9e5e427c01/

Commit: 2131eb2a28cc648235e0fd0dafb57e9e5e427c01

It may take a minute or two for the page to go live after the workflow completes.

claude added 3 commits June 12, 2026 00:25
- Pin r0adkll/upload-google-play to commit SHA (v1.1.3) to prevent supply chain risk
- Remove unused aab-path job output and locate-aab step
- Change deploy status from completed to inProgress (safer default)
- Use annotated tag instead of lightweight tag in bump-version.js
- Push only the new tag explicitly instead of --tags (all local tags)
- Replace git -C path interpolation with cwd option in execSync calls
- Switch trigger from version tags to push-to-main/release/* branches
- Add PR path: runs assembleDebug for verification (no secrets needed)
- Replace r0adkll GitHub Action with publishReleaseBundle Gradle task
  using ANDROID_PUBLISHER_CREDENTIALS env var (matches HeapGame)
- Collapse build + deploy into single job with event-based conditionals
- Add Gradle Play Publisher plugin (triple-t 3.11.0) to android build
- Upgrade Node from 22 to 24
@cph5236 cph5236 merged commit 95b975d into main Jun 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants