This document outlines the steps required to release a new version of the project. The process includes both automated steps, executed via GitHub Actions, and manual steps that require human intervention.
- Initial Setup for Maven Publishing
- Automated Deployment Process
- Manual Steps After Deployment
- Rationale for Manual Steps
- Example Commands
To be completed.
The deployment process is automated using a release.yml
GitHub Actions workflow. This workflow is triggered when a new tag is pushed to the master
branch.
- User Action: Creates a new tag (e.g.,
v1.0.0-beta1
). - Workflow Trigger: GitHub Actions listens for new tags on the
master
branch. - Workflow Steps:
- Checkout Code for New Tag
- Set New Version in Repository
- Commit and Push Changes to Release Branch
- Create GitHub Release Based on Tag
- Deploy Artifacts:
- Deploy to Internal Nexus
- Deploy to Maven Central
-
Tagging a Release
-
Action: A user creates a new tag in the repository, e.g.,
v1.0.0-beta1
. -
Command:
git tag -a v1.0.0-beta1 -m "Version 1.0.0-beta1" git push origin v1.0.0-beta1
-
Note: The tag should follow Semantic Versioning conventions.
-
-
Workflow Trigger
-
Action: The GitHub Actions workflow listens for new tags on the
master
branch. -
Configuration:
on: push: tags: - 'v*' branches: - master
-
Outcome: When a new tag matching the pattern is detected, the workflow is triggered.
-
-
Checkout Code for New Tag
-
Action: The workflow checks out the code corresponding to the new tag.
-
Uses:
actions/checkout@v3
action. -
Step:
- name: Checkout Code uses: actions/checkout@v3 with: ref: ${{ github.ref }}
-
-
Set New Version in Repository
-
Action: Update the project version using Maven.
-
Command:
mvn versions:set -DnewVersion=${GITHUB_REF_NAME}
-
Workflow Step:
- name: Set Project Version run: mvn versions:set -DnewVersion=${GITHUB_REF_NAME}
-
-
Commit and Push Changes to Release Branch
-
Action: Commit the version changes and push to a new release branch.
-
Commands:
git checkout -b release/${GITHUB_REF_NAME} git add pom.xml git commit -m "Set version to ${GITHUB_REF_NAME}" git push origin release/${GITHUB_REF_NAME}
-
Workflow Steps:
- name: Commit Version Changes run: | git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" git checkout -b release/${GITHUB_REF_NAME} git add pom.xml git commit -m "Set version to ${GITHUB_REF_NAME}" git push origin release/${GITHUB_REF_NAME}
-
-
Create GitHub Release Based on Tag
-
Action: Create a new GitHub release using the tag.
-
Uses:
actions/create-release@v1
action. -
Workflow Step:
- name: Create Release uses: actions/create-release@v1 with: tag_name: ${{ github.ref_name }} release_name: Release ${{ github.ref_name }} body: | ## What's New - Describe the changes here. draft: false prerelease: ${{ contains(github.ref_name, '-beta') }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-
Deploy Artifacts
-
Deploy to Internal Nexus
-
Command:
mvn clean deploy -P release -DaltDeploymentRepository=nexus::default::http://your-internal-nexus/repository
-
Workflow Step:
- name: Deploy to Internal Nexus run: mvn clean deploy -P release -DaltDeploymentRepository=nexus::default::http://your-internal-nexus/repository env: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
-
-
Deploy to Maven Central
-
Condition: Only if the tag does not contain
-beta
. -
Command:
mvn clean deploy -P release
-
Workflow Step:
- name: Deploy to Maven Central if: ${{ !contains(github.ref_name, '-beta') }} run: mvn clean deploy -P release env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
-
-
Credentials:
- Provided via GitHub secrets:
NEXUS_USERNAME
NEXUS_PASSWORD
SONATYPE_USERNAME
SONATYPE_PASSWORD
- Provided via GitHub secrets:
-
While the automated process handles most of the deployment tasks, some steps require manual intervention to ensure accuracy and compliance.
-
Publish PGP Key
- Action: Ensure your PGP key is published on OpenPGP Key Server.
- Reason: Required for signing artifacts and verifying authenticity.
-
Push Remaining Changes
- Action: Push any remaining changes to the repository, if necessary.
-
Finalize the Release on GitHub
- Action: If the release was not automatically created, manually create it on GitHub.
- Details: Include release notes, changelog, and any relevant information.
-
Announce the New Release
- Action: Make announcements about the new release.
- Channels: Email lists, social media, project website, etc.
-
Update Documentation
- Action: Update all documentation to reflect the new version.
- Steps:
-
Perform a global search and replace to update the version number:
find . -name "*.md" -exec sed -i 's/old_version/new_version/g' {} +
-
Upload any new schemas or assets to the project pages.
-
Update the Getting Started guide and examples.
-
While automation increases efficiency, certain tasks benefit from manual oversight to maintain quality and compliance.
-
PGP Key Verification
- Ensuring the PGP key is correctly published and accessible is crucial for security.
-
Documentation Updates
- Manual review ensures that the documentation accurately reflects the changes and is free of errors.
-
Release Announcements
- Crafting personalized announcements helps engage the community and stakeholders effectively.
Here are some example commands to assist with the release process:
# For a beta release
git tag -a v1.0.0-beta1 -m "Version 1.0.0-beta1"
git push origin v1.0.0-beta1
# For a stable release
git tag -a v1.0.0 -m "Version 1.0.0"
git push origin v1.0.0
# Set the project version to match the tag
mvn versions:set -DnewVersion=1.0.0-beta1
# Deploy to Internal Nexus (for beta releases)
mvn clean deploy -P release -DaltDeploymentRepository=nexus::default::http://your-internal-nexus/repository
# Deploy to Maven Central (for stable releases)
mvn clean deploy -P release