This document describes the manual draft release process for xAPI Java.
The release process is manually controlled via draft releases and GitHub Actions workflow dispatch. Releases are initiated on-demand with explicit version control:
- Create a draft release in GitHub UI with a semver tag
- Go to Actions tab and trigger the "Manual Draft Release" workflow
- Enter the draft release title
- Wait for workflow to complete ✅
All version management, building, testing, and deployment happens in a controlled, manual process.
- Navigate to the Releases page
- Click "Draft a new release"
- Fill in the release details:
- Tag: Enter a semver tag in format
vX.Y.Z(e.g.,v1.2.0)- Important: Tag MUST include the
vprefix followed by semantic version numbers - Example:
v1.1.20,v2.0.0,v1.2.3
- Important: Tag MUST include the
- Release title: Use the same tag name (e.g.,
v1.2.0) - Target: Select the branch to release from (typically
main) - Description: Add release notes describing the changes
- Tag: Enter a semver tag in format
- Click "Save draft" - do NOT publish yet
- Navigate to the Actions tab
- Click on "Manual Draft Release" workflow in the left sidebar
- Click the "Run workflow" button (top right)
- Fill in the workflow input:
- Draft release title: Enter the exact title of your draft release (e.g.,
v1.2.0)- Must match the title from Step 1 exactly
- Format:
vX.Y.Zwith thevprefix
- Draft release title: Enter the exact title of your draft release (e.g.,
- Click "Run workflow" to start the release process
Once you trigger the workflow, the "Manual Draft Release" workflow will:
- ✅ Validate the draft release title format (must be
vX.Y.Z) - ✅ Find and validate the draft release in GitHub
- ✅ Extract version information from the draft release
- ✅ Run Maven release:prepare to:
- Update all
pom.xmlfiles to the release version (e.g., 1.2.0) - Commit the version change
- Create the release tag (e.g., v1.2.0) pointing to the release commit
- Update
pom.xmlfiles to the next SNAPSHOT version (e.g., 1.2.1-SNAPSHOT) - Commit the next development iteration
- Update all
- ✅ Update example version numbers in documentation:
- Automatically update version numbers in README.md dependency examples
- Create a third commit with the documentation updates
- Ensures documentation examples always match the release version
- ✅ Run Maven release:perform to:
- Check out the release tag
- Build and test the release version
- Deploy artifacts to Maven Central with GPG signatures
- ✅ Push commits and tag back to the target branch
- ✅ Upload release artifacts (JAR files) to the draft release
- ✅ Publish the GitHub Release (remove draft status)
Workflow Diagram:
User Action: Create draft release in GitHub UI
- Title: v1.2.0
- Tag: v1.2.0
- Target: main
↓
User Action: Trigger "Manual Draft Release" workflow
- Draft release title: v1.2.0
↓
Workflow: Validates title format (v1.2.0)
↓
Workflow: Finds draft release with title "v1.2.0"
↓
Workflow: Extracts version (1.2.0) and target branch (main)
↓
Workflow: Runs release:prepare on main branch
↓
- Commit A: pom.xml → 1.2.0 (release version)
- Creates tag v1.2.0 → commit A
- Commit B: pom.xml → 1.2.1-SNAPSHOT (next dev version)
↓
Workflow: Updates example versions in documentation
↓
- Updates README.md with version 1.2.0
- Commit C: Documentation updates
↓
Workflow: Runs release:perform
↓
- Checks out tag v1.2.0 (commit A)
- Builds and tests
- Deploys to Maven Central
↓
Workflow: Pushes commits A, B & C to main
↓
Workflow: Pushes tag v1.2.0 → commit A
↓
Workflow: Uploads JAR artifacts to draft release
↓
Workflow: Publishes the GitHub Release
↓
Result:
- Tag v1.2.0 → commit A (release version: 1.2.0)
- Main branch → commit C (next SNAPSHOT: 1.2.1-SNAPSHOT, with updated docs)
- Artifacts deployed to Maven Central
- GitHub Release published with JAR files
- Check the Actions tab to ensure the workflow completed successfully
- The workflow will show a summary of the release including version, tag, and status
- Verify the target branch (e.g.,
main) has three new commits:- Release commit:
[maven-release-plugin] prepare release vX.Y.Z - Development commit:
[maven-release-plugin] prepare for next development iteration - Documentation commit:
[release] Update documentation examples to version X.Y.Z
- Release commit:
- Verify the GitHub Release was published at the Releases page
- The release should no longer be in draft state
- JAR artifacts should be attached to the release
- Verify documentation examples were updated:
- Check that README.md contains the correct version in dependency examples
- The version should match the release version (e.g., 1.2.0)
- Verify artifacts are available on Maven Central
- Note: It may take up to 2 hours for artifacts to sync to Maven Central
The manual draft release approach provides several advantages:
- Full Control: Releases happen only when explicitly triggered, not automatically
- Predictability: No unexpected releases due to automation triggers
- Review First: Create and review draft releases before triggering deployment
- Release Notes: Prepare release notes in advance as part of the draft
- Artifact Attachment: Release artifacts (JARs) are automatically uploaded to the GitHub Release
- Coordination: Coordinate releases with code reviews and team schedules
- Automated Documentation: Version numbers in documentation examples are automatically updated to match the release version
- Main branch (
main) (or other target branch): Contains development code with-SNAPSHOTversions- After each release, receives two commits from Maven release plugin:
- Release commit: Version update to release version (X.Y.Z)
- Development commit: Version update to next development version (X.Y.Z+1-SNAPSHOT)
- The HEAD always points to the next development version
- After each release, receives two commits from Maven release plugin:
- Release tags (
vX.Y.Z): Created by Maven release plugin during workflow execution- Points to the release version commit (first commit)
- Used for reproducible builds and deployments
- No separate release branches: The release workflow pushes directly to the selected branch
The release workflow automatically updates version numbers in documentation examples to match the release version. This ensures users always see correct, up-to-date version numbers when copying examples from the documentation.
The automation updates version numbers in:
- README.md: All Maven dependency examples for xapi-client, xapi-model, and xapi-model-spring-boot-starter
- After Maven release:prepare completes, a script (
.github/scripts/update-example-versions.sh) runs automatically - The script extracts the release version from the root
pom.xml - It updates all
<version>X.Y.Z</version>tags within dependency blocks in README.md - The changes are committed as a separate third commit after the release commit (not amending the release commit)
- The release tag continues to point to the original release commit (not the documentation update commit)
- No manual updates needed: Version numbers are updated automatically during release
- Always accurate: Documentation examples always reference the current release version
- Transparent: Changes appear in the release commit and are visible in pull requests
- Single source of truth: Uses Maven's version from pom.xml as the authoritative source
The script uses simple pattern matching to find and replace version numbers. If new files need to be updated:
- Edit
.github/scripts/update-example-versions.sh - Add the file path to the
FILES_TO_UPDATEarray - Commit the change
The script will automatically update all listed files in future releases.
You can edit a draft release before triggering the workflow:
- Navigate to the Releases page
- Find your draft release
- Click "Edit"
- Update release notes, title, or target branch as needed
- Click "Save draft"
- Then trigger the workflow with the updated title
The workflow preserves the release notes you write in the draft release:
- When creating the draft release, write detailed release notes
- The workflow will keep these notes when publishing the release
- After publication, the release will show your notes plus attached JAR artifacts
If the manual draft release workflow fails:
-
Check the workflow logs in the Actions tab
-
Identify the failed step and review the error message
-
Common issues and solutions:
Issue Solution Invalid title format Use format vX.Y.Z(e.g.,v1.2.0) - MUST includevprefixDraft release not found Ensure you created a draft release with the exact title you entered Release is not a draft The release must be in draft state - edit it and set to draft No tag name set Ensure the draft release has a tag name configured Missing secrets Ensure GPG keys and Maven credentials are configured in repository secrets Build failures Fix build issues on target branch first, then retry release Test failures Fix failing tests on target branch first, then retry release Branch divergence Someone pushed to the branch during release. Check the error and retry -
After fixing issues:
- If commits were NOT pushed: Simply re-run the workflow with the same title
- If commits were pushed:
- Delete the tag in GitHub UI (if it was created)
- Delete the published release (if it was published)
- Reset your target branch if needed:
# If release:prepare pushed commits before failure git fetch origin git checkout main # or your target branch git reset --hard origin/main~2 # Remove the 2 release commits git push -f origin main
- Create a new draft release
- Re-run the workflow
The workflow typically takes 5-10 minutes. If it's taking longer:
- Check if tests are running (this is the longest step)
- Check for any hanging processes in the workflow logs
- You can cancel the workflow run and restart it
If artifacts don't appear on Maven Central after a successful workflow:
- Check the Central Portal for deployment status: https://central.sonatype.com/
- Deployment can take up to 2 hours to sync to Maven Central
- Check for any deployment errors in the workflow logs
- Verify GPG signing was successful (check for GPG-related errors)