Skip to main content

release.py

release.py automates the complete release process for Apache Juneau, including prerequisite checks, building, testing, Maven release, binary artifact creation, and SVN distribution upload.

What It Does

The script performs the following steps:

  1. Check Prerequisites - Verifies required tools are available
  2. Check Java Version - Automatically detects and verifies Java 17+
  3. Check Maven Version - Automatically detects and verifies Maven 3+
  4. Clean Maven Repository - Cleans local Maven repo (only on first run for a version)
  5. Make Git Folder - Creates staging directory
  6. Clone Juneau - Clones the repository to staging directory
  7. Configure Git - Sets up git user and email
  8. Run Clean Verify - Builds and verifies the project
  9. Run Deploy - Deploys to Maven staging repository
  10. Run Release Prepare - Prepares the Maven release
  11. Run Release Perform - Performs the Maven release
  12. Create Binary Artifacts - Downloads and processes source/binary artifacts
  13. Verify Distribution - Verifies files on Apache distribution site

Usage

Start a New Release

python3 scripts/release.py

The script will prompt you for the release candidate number.

Resume from a Step

python3 scripts/release.py --start-step run_release_perform

List Available Steps

python3 scripts/release.py --list-steps

Skip Specific Steps

python3 scripts/release.py --skip-step clean_maven_repo

Resume from Last Checkpoint

python3 scripts/release.py --resume

Revert a Release

python3 scripts/release.py --revert

The revert option will:

  • Delete the git tag (both local and remote)
  • Revert Maven versions back to the development snapshot
  • Clean up SVN files (remove RC directories from dist.apache.org)

The script will automatically detect the version and RC number from state files or history, or prompt you if needed.

Command-Line Options

Optional

  • --start-step STEP_NAME - Start execution from the specified step
  • --list-steps - List all available steps and exit
  • --skip-step STEP_NAME - Skip a specific step (can be used multiple times)
  • --resume - Resume from the last checkpoint (if available)
  • --revert - Revert a release by deleting the git tag, reverting Maven versions, and cleaning up SVN files

Environment Variables

The script prompts for and sets the following environment variables:

  • X_VERSION - Current release version (detected from pom.xml)
  • X_NEXT_VERSION - Next version (calculated)
  • X_RELEASE - Full release name (e.g., "juneau-9.2.0-RC1")
  • X_RELEASE_CANDIDATE - Release candidate number (prompted for at start)
  • X_STAGING - Staging directory path
  • X_USERNAME - Apache username
  • X_EMAIL - Apache email
  • X_GIT_BRANCH - Git branch name
  • X_JAVA_HOME - Java home directory
  • X_CLEANM2 - Whether to clean Maven repo (Y/N)

History Files

The script maintains history files (release-history-{version}.json) that store:

  • X_VERSION - The release version
  • X_RELEASE_CANDIDATE - Release candidate number
  • Default values for prompts (staging directory, username, email, etc.)
  • Last run date
  • Previous configuration values

This allows the script to provide intelligent defaults on subsequent runs and enables the --revert option to automatically detect what needs to be reverted.

Checkpoint/Resume

The script supports checkpoint/resume functionality:

  • State is saved to ~/.juneau-release-state.json
  • You can resume from any step using --resume or --start-step
  • The release candidate number is prompted for at start, or extracted from state/history when resuming

Vote Email Generation

After successful distribution verification, the script automatically generates a vote email body with:

  • Version and RC number
  • Distribution URLs
  • SHA-512 checksums (fetched from URLs)
  • Git commit hash
  • Vote end date (72 hours from now)

The email is printed to the console.

Prerequisites

  • Python 3.6 or higher
  • Java 17 or higher
  • Maven 3 or higher
  • Git
  • GPG (for signing)
  • SVN client (for distribution upload)
  • wget (for downloading artifacts)

Notes

  • The script automatically excludes docs from the source release zip (via maven-source-plugin configuration)
  • Source and binary artifacts are downloaded from Maven staging repository
  • SHA512 checksum files are copied as-is from the Maven repository (they are automatically generated by Maven during deployment)
  • Distribution verification checks for expected files on Apache distribution site
  • The script uses current-release.py and maven-version.py for version detection
  • Javadoc generation, test workspace creation, and git diff steps have been removed from the release process
  • The --revert option can be used to undo a release candidate if needed before voting
Discussion

Share feedback or follow-up questions for this page directly through GitHub.