From 1aeaa5b13b641fc024b5fb4775c8321ca7043b2e Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Sun, 4 Oct 2026 20:45:49 -0400 Subject: [PATCH] ci(release): add skip_bump to record a production release without a patch bump The workflow bumps Flipcash.patchVersion whenever production changes. When Packaging.kt is already ahead of the release being recorded (Play promoted 2026.9.4 while code/cash was on 2026.10.1), the only way to update the manifest was to run the script locally. skip_bump writes the manifest and stops before the bump; the commit reads "build: release Flipcash ()". Setting it with force_bump fails. emit() also no longer ends on a failing `[ -n "$GITHUB_OUTPUT" ]` test, which under set -e stopped local runs after the first output. --- .github/workflows/bump-patch.yml | 12 ++++++++++-- scripts/update-release-manifest.sh | 21 +++++++++++++++++++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bump-patch.yml b/.github/workflows/bump-patch.yml index 5c49aee4ba..b1f8933880 100644 --- a/.github/workflows/bump-patch.yml +++ b/.github/workflows/bump-patch.yml @@ -18,6 +18,11 @@ on: required: false default: false type: boolean + skip_bump: + description: 'Record the manifest without bumping the patch version (e.g. Packaging.kt is already ahead)' + required: false + default: false + type: boolean jobs: release: @@ -44,6 +49,7 @@ jobs: SERVICE_ACCOUNT_KEY_JSON: ${{ steps.service_account_json_file.outputs.filePath }} TRACKS: ${{ github.event.inputs.track }} FORCE_BUMP: ${{ github.event.inputs.force_bump }} + SKIP_BUMP: ${{ github.event.inputs.skip_bump }} run: bash scripts/update-release-manifest.sh - name: Commit & Push changes @@ -54,11 +60,13 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add -A - COMMIT_MSG="${{ steps.manifest.outputs.prod_changed == 'true' + COMMIT_MSG="${{ steps.manifest.outputs.prod_changed == 'true' && steps.manifest.outputs.skipped == 'true' + && format('build: release Flipcash {0} ({1})', steps.manifest.outputs.new_prod_name, steps.manifest.outputs.new_prod) + || (steps.manifest.outputs.prod_changed == 'true' && format('build: release Flipcash {0} ({1}), bump to {2}', steps.manifest.outputs.new_prod_name, steps.manifest.outputs.new_prod, steps.manifest.outputs.version) || (steps.manifest.outputs.forced == 'true' && format('build: bump Flipcash to {0}', steps.manifest.outputs.version) - || 'build: update release manifest') }}" + || 'build: update release manifest')) }}" git commit -m "$COMMIT_MSG" git pull --rebase https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git code/cash git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git HEAD:code/cash diff --git a/scripts/update-release-manifest.sh b/scripts/update-release-manifest.sh index c02d9d307c..ba98c42132 100755 --- a/scripts/update-release-manifest.sh +++ b/scripts/update-release-manifest.sh @@ -5,6 +5,10 @@ # updates .well-known/release-manifest.json in place, and bumps # Flipcash.patchVersion in Packaging.kt when production changes. # +# FORCE_BUMP=true bumps the patch even when production is unchanged. +# SKIP_BUMP=true records the tracks without bumping, for when Packaging.kt +# is already ahead of the release being recorded. Setting both is an error. +# # Env: # SERVICE_ACCOUNT_KEY_JSON — path to the Google service account JSON file # PKG — package name (default: com.flipcash.app.android) @@ -16,7 +20,8 @@ # Outputs (written to $GITHUB_OUTPUT when running in CI): # old_prod / new_prod — previous and current production versionCode # prod_changed — "true" | "false" -# version — new versionName (only when prod_changed=true) +# version — new versionName (only when the patch was bumped) +# skipped — "true" when SKIP_BUMP suppressed a bump set -euo pipefail @@ -33,6 +38,11 @@ PKG="${PKG:-com.flipcash.app.android}" MANIFEST_PATH="${MANIFEST_PATH:-.well-known/release-manifest.json}" TRACKS="${TRACKS:-production beta alpha internal}" FORCE_BUMP="${FORCE_BUMP:-false}" +SKIP_BUMP="${SKIP_BUMP:-false}" + +if [ "$FORCE_BUMP" = "true" ] && [ "$SKIP_BUMP" = "true" ]; then + echo "FORCE_BUMP and SKIP_BUMP cannot both be set"; exit 1 +fi ALL_TRACKS="production beta alpha internal" @@ -42,7 +52,7 @@ in_list() { [[ " $2 " == *" $1 "* ]]; } # --- helper: write to $GITHUB_OUTPUT when in CI, otherwise just print --- emit() { echo "$1=$2" - [ -n "${GITHUB_OUTPUT:-}" ] && echo "$1=$2" >> "$GITHUB_OUTPUT" + if [ -n "${GITHUB_OUTPUT:-}" ]; then echo "$1=$2" >> "$GITHUB_OUTPUT"; fi } # --- mint access token --- @@ -162,6 +172,13 @@ if [ "$FORCE_BUMP" != "true" ] && [ "$PROD_CHANGED" != "true" ]; then fi emit "prod_changed" "$PROD_CHANGED" + +if [ "$SKIP_BUMP" = "true" ]; then + echo "skip_bump set, recording the manifest without a patch bump" + emit "skipped" "true" + exit 0 +fi + emit "forced" "$FORCE_BUMP" echo "Bumping patch version (prod_changed=$PROD_CHANGED, forced=$FORCE_BUMP)"