| allowed-tools | Bash(grep:*), Bash(git describe:*), Bash(git branch:*), Bash(git log:*), Bash(git diff:*), Bash(git status:*), Bash(git tag:*), Bash(git add:*), Bash(git commit:*), Bash(git reset:*), Bash(gh repo view:*), Bash(gh release view:*), Bash(gh run:*), Bash(gh run list:*), Bash(gh run watch:*), Bash(gh run rerun:*), Bash(gh workflow run:*), Bash(./gradlew:*), Edit, Read |
|---|---|
| description | Release a new version - bump version, commit, tag, push, publish to Maven Central, create GitHub release |
| argument-hint | [major|minor|patch|<explicit-version>] |
- Current version: !
grep '^library' gradle/libs.versions.toml - Latest git tag: !
git describe --tags --abbrev=0 2>/dev/null || echo "(no tags)" - Current branch: !
git branch --show-current - GitHub repo: !
gh repo view --json nameWithOwner -q .nameWithOwner
Follow these steps precisely to create a new release.
- Verify we are on the
masterbranch. If not, stop and warn the user. - Verify the working tree is clean (
git status --porcelain). If not, stop and warn the user. - Pull latest:
git pull --ff-only. If this fails, stop and warn the user.
The current version uses pre-release identifiers (e.g., 1.0.0-alpha03). Version bumping rules:
If $ARGUMENTS is one of major, minor, or patch:
- patch: increment the last numeric segment (e.g.,
1.0.0-alpha03→1.0.0-alpha04, or1.2.3→1.2.4) - minor:
X.Y.Z→X.Y+1.0(drops any pre-release suffix) - major:
X.Y.Z→X+1.0.0(drops any pre-release suffix) — always confirm with user first
If $ARGUMENTS is an explicit version string (e.g., 1.0.0-beta01 or 1.0.0), use it directly.
Otherwise, analyze the commits since the last tag and suggest an appropriate bump. Present the proposed new version to the user and ask them to confirm using AskUserQuestion.
List the commits since the last tag using git log <last-tag>..HEAD --oneline. Write concise, user-facing bullet points for each meaningful change. These will be used in the GitHub release body alongside the auto-generated changelog.
Do all of the following in order:
- Edit
gradle/libs.versions.tomlto update thelibraryversion on line 9 to the new version - Build to verify nothing is broken:
If the build fails, stop and help the user fix the issue before continuing.
./gradlew apiDump ./gradlew :core:build - Stage and commit:
git add gradle/libs.versions.toml core/api/ git commit -m "release: vX.Y.Z" - Tag:
git tag vX.Y.Z - Push:
git push && git push --tags
After pushing, monitor the CI workflows triggered by the push:
- Wait a moment for workflows to trigger, then use
gh run list --branch master --limit 5to find the runs - Use
gh run watch <run-id>on the test workflow run
If all checks pass, proceed to Step 6.
If any check fails:
- Flaky/random failure: Rerun with
gh run rerun <run-id> --failed, then wait again - Real failure: We need to roll back and fix the issue:
- Delete the remote tag:
git push --delete origin vX.Y.Z - Delete the local tag:
git tag -d vX.Y.Z - Revert the release commit:
git reset --hard HEAD~1 && git push --force - Help the user fix the issue, then re-release
- Delete the remote tag:
Create the release on GitHub using the auto-generated changelog:
gh release create vX.Y.Z --title "vX.Y.Z" --generate-notes
This will:
- Create a GitHub release with auto-generated PR-based changelog
- Automatically trigger the
apple-binaries.ymlworkflow (attaches XCFramework archives to the release)
Trigger the publish workflow manually:
gh workflow run publish.yml
- Use
gh run list --limit 5to find the publish and apple-binaries workflow runs - Watch both with
gh run watch <run-id> - If the publish workflow fails, inform the user — they may need to check Maven Central / Sonatype credentials
- If apple-binaries fails, it can be re-triggered:
gh workflow run apple-binaries.yml
Once all workflows complete successfully, report:
- Link to the GitHub release
- Confirm Maven Central publish status
- Confirm Apple XCFramework archives attached to release