Skip to content

build: rewrite release script in Python - #113

Merged
nyg merged 2 commits into
masterfrom
nyg/release-script-python-fee12f
Sep 23, 2026
Merged

nyg merged 2 commits into
masterfrom
nyg/release-script-python-fee12f

Conversation

@nyg

@nyg nyg commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Replaces scripts/create-release.sh, which hard-coded the release and development versions, with scripts/create-release.py, run as scripts/create-release.py patch|minor|major.

The script:

  • aborts if examples/src/main/resources/api-keys.properties exists, so a real key file cannot end up in a release build;
  • fetches tags from origin and takes the highest v* tag as the current version, so a stale clone cannot compute an already released version, and bumps it: patch 4.0.0 → 4.0.1, minor → 4.1.0, major → 5.0.0, with the next development version set to the release's patch + 1 as -SNAPSHOT;
  • asks for confirmation, then runs mvnd --serial -Dtag=vX -DreleaseVersion=X -DdevelopmentVersion=… release:prepare release:perform from the repository root;
  • offers to open https://central.sonatype.com/publishing, where the validated deployment is published manually.

docs/RELEASE.md now describes the script in its Summary section.

Design notes

  • The current version comes from the latest tag, not from the POM: the POM already holds X.Y.(Z+1)-SNAPSHOT after a release, so bumping the patch from it would skip a version.
  • The script calls mvnd, matching the --serial flag used in docs/RELEASE.md.
  • It only uses the Python standard library.

Testing

Ran the script with no argument, an invalid argument, and each of patch, minor and major, declining the confirmation prompt; the computed versions were 4.0.1, 4.1.0 and 5.0.0 respectively. With a dummy api-keys.properties in place, it aborted before computing versions. The actual Maven release and browser prompt have not been exercised.

@sonarqubecloud

Copy link
Copy Markdown

@nyg
nyg merged commit e5bc880 into master Sep 23, 2026
6 checks passed
@nyg
nyg deleted the nyg/release-script-python-fee12f branch September 23, 2026 19:55
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.

1 participant