name: bump-version-and-release description: Bump version in code and plugin config, create a release PR, then tag to trigger the Bitrise release pipeline. disable-model-invocation: true allowed-tools: Bash(go *), Bash(git *), Bash(gh *), Bash(golangci-lint *), Read, Grep, Edit
Bump Version and Release
Current version in main.go: !grep 'version = ' cmd/codepush/version.go | head -1 | sed 's/.*"\(.*\)".*/\1/'
New version: $ARGUMENTS
Instructions
Follow these steps in order. Stop and report if any step fails.
Phase 1: Pre-flight checks
- Validate that
$ARGUMENTSis a valid semantic version (X.Y.Z or X.Y.Z-suffix):echo "$ARGUMENTS" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$' - Verify git working directory is clean:
git status --porcelainshould be empty - Verify on
mainbranch:git branch --show-currentshould outputmain - Pull latest:
git pull origin main - Run tests:
go test ./... - Run linter:
golangci-lint run
Phase 2: Version bump
- Update
cmd/codepush/version.go: changeversion = "OLD"toversion = "NEW" - Update
bitrise-plugin.yml: replace the old version in all three download URLs with the new version - Verify both files have the new version:
grep 'version = ' cmd/codepush/version.go grep 'download/' bitrise-plugin.yml - Run
go build ./cmd/codepushto verify the build still works
Phase 3: Create release PR
- Create and switch to branch:
git checkout -b release/$ARGUMENTS - Stage and commit:
git add cmd/codepush/version.go bitrise-plugin.yml git commit -m "chore: bump version to $ARGUMENTS" - Push and create PR:
git push -u origin release/$ARGUMENTS gh pr create --title "chore: bump version to $ARGUMENTS" --body "Automated version bump to $ARGUMENTS. After this PR is merged, the release tag will be created to trigger the Bitrise release pipeline." - Print the PR URL for the user.
Phase 4: Tag and release (after PR merge)
Ask the user to confirm the PR has been merged before proceeding.
- Switch back to main and pull:
git checkout main git pull origin main - Create and push the tag:
git tag -a $ARGUMENTS -m "Release $ARGUMENTS" git push origin $ARGUMENTS - Confirm: the tag push triggers the Bitrise
pipeline_releaseautomatically. Print the Bitrise dashboard link or instruct the user to check Bitrise for the release build.
Phase 5: Verify
- After the Bitrise release pipeline completes, verify the GitHub release:
gh release view $ARGUMENTS - Check that all expected assets are present:
codepush-Darwin-arm64codepush-Darwin-x86_64codepush-Linux-x86_64checksums.txt