This document describes how to create a new release of Stoic.
Before starting a release, ensure you have:
-
An ARM Mac
- The release script verifies that stoic works on Darwin arm64
-
A physical Android device attached (not an emulator)
- The release script runs integration tests on the built artifacts
- This ensures Stoic works correctly on macOS (not just in CI on Linux)
- We could run CI on macOS, but that would complicate emulator usage and make tests slower
- Check device is connected:
adb devices
-
Clean git working directory
- All changes must be committed
- Must be on the
mainbranch
-
GitHub CLI authenticated
- Install:
brew install gh - Login:
gh auth login
- Install:
The release script automates the entire release process. Run:
./release.shThe script will:
-
Validate and confirm the release version
- Shows current version (e.g.,
0.6.1-SNAPSHOT) - Shows release version (e.g.,
0.6.1) - Shows post-release version (e.g.,
0.6.2-SNAPSHOT) - Asks for confirmation before proceeding
- Shows current version (e.g.,
-
Run shellcheck on all shell scripts
-
Create release branch (
release/X.Y.Z)- Updates
prebuilt/STOIC_VERSIONto remove-SNAPSHOT - Commits and pushes the branch
- Updates
-
Wait for GitHub Actions build
- Monitors the
buildworkflow for the release branch - Downloads the built artifacts when complete
- Monitors the
-
Extract and verify artifacts
- Extracts the release tarball
- Adds the built binary to PATH
-
Run integration tests on your attached device
- Verifies the correct stoic binary is being used (
which stoic) - Verifies the version matches the release (
stoic --version) - Runs all tests via
test/run-all-tests-on-connected-device.sh - These tests verify the release works on macOS with real hardware
- Verifies the correct stoic binary is being used (
-
Tag the release (
vX.Y.Z)- Creates an annotated git tag
- Pushes the tag to GitHub
-
Wait for GitHub Actions release workflow
- Publishes to Maven Central (plugin-sdk and app-sdk)
- Creates GitHub release with tarball
- Prints verification URLs:
- GitHub Release:
https://github.com/block/stoic/releases/tag/vX.Y.Z - Maven Central (plugin-sdk):
https://central.sonatype.com/artifact/com.squareup.stoic/plugin-sdk/X.Y.Z - Maven Central (app-sdk):
https://central.sonatype.com/artifact/com.squareup.stoic/app-sdk/X.Y.Z
- GitHub Release:
- Note: Maven Central artifacts may take up to 30 minutes to become available for download
-
Merge release branch to main
- Fast-forward merge only
-
Bump version for next development cycle
- Updates
prebuilt/STOIC_VERSIONtoX.Y.Z+1-SNAPSHOT - Commits and pushes to main
- Updates
-
Update Homebrew formula
- Triggers
update-stoic.yamlworkflow inblock/homebrew-tap - Waits for the workflow to complete
- Prints verification URL:
https://github.com/block/homebrew-tap/blob/main/Formula/stoic.rb
- Triggers
-
Print success message with all release artifact URLs
The release script supports automatic resumption if something fails partway through. The script tracks progress in releases/X.Y.Z/.prepare_state.
Each major step in the release process is tracked:
SHELLCHECK- Shellcheck validationCREATE_BRANCH- Release branch creationWAIT_BUILD- GitHub Actions buildEXTRACT- Artifact extractionVERIFY_TESTS- Integration testsTAG_RELEASE- Git tag creationWAIT_RELEASE- GitHub Actions releaseMERGE_MAIN- Merge to mainBUMP_SNAPSHOT- Version bumpUPDATE_HOMEBREW- Homebrew formula update
If the script fails or is interrupted:
- Fix the underlying issue (e.g., failing test, network error)
- Run
./release.shagain - The script will skip already-completed steps
- It will resume from the first incomplete step
If you need to completely restart a release:
# Delete the artifacts directory
rm -r releases/X.Y.Z
# Delete the release branch (if created)
git checkout main
git branch -D release/X.Y.Z
git push origin --delete release/X.Y.Z
# Delete the tag (if created)
git tag -d vX.Y.Z
git push origin --delete vX.Y.Z
# Run the release script again
./release.shStoic uses semantic versioning (MAJOR.MINOR.PATCH):
- Development versions end with
-SNAPSHOT(e.g.,0.6.1-SNAPSHOT) - Release versions have no suffix (e.g.,
0.6.1) - The script automatically:
- Strips
-SNAPSHOTfor the release - Increments the patch version and adds
-SNAPSHOTfor the next development cycle
- Strips
- GitHub Actions may be delayed. Wait a few minutes and the script will find it.
- Check the workflow logs:
gh run view --repo block/stoic - Common issues:
- Maven Central credentials not configured (repository secrets)
- GPG signing key issues (repository secrets)
- Make sure a device is attached:
adb devices - Check device is unlocked and screen is on
- Verify
ANDROID_HOMEis set correctly - Check which stoic binary is being used:
which stoic(should be fromreleases/X.Y.Z/verify/bin/darwin-arm64/stoic) - Verify the version:
stoic --version(should show the release version) - Run tests manually:
test/run-all-tests-on-connected-device.sh
- Check the workflow manually:
https://github.com/block/homebrew-tap/actions - The workflow may need manual intervention if there are conflicts
- You can manually trigger it:
gh workflow run update-stoic.yaml --repo block/homebrew-tap --field tag=vX.Y.Z
Each release produces:
-
GitHub Release (
https://github.com/block/stoic/releases/tag/vX.Y.Z)stoic-release.tar.gz- Complete release bundle with:- Native binaries (darwin-arm64)
- JAR files
- SDK artifacts
- Demo plugins and apps
- Prebuilt files
-
Maven Central Artifacts
com.squareup.stoic:plugin-sdk:X.Y.Z- Plugin development SDK (JAR)com.squareup.stoic:app-sdk:X.Y.Z- App integration SDK (AAR)- Both include sources and javadoc
-
Homebrew Formula
- Updated in
block/homebrew-taprepository - Users can install with:
brew install block/tap/stoic
- Updated in
After a successful release:
- Verify the GitHub release page looks correct
- Test installing via Homebrew:
brew upgrade stoic(if already installed) orbrew install block/tap/stoic - Verify Maven Central artifacts are available (may take up to 30 minutes):
- Check the URLs printed by the release script