Skip to content
A.J. Stein edited this page Sep 29, 2023 · 5 revisions

Onboarding New Developers for Project Maintenance

Release Procedures

  • Rebase develop branch on main to ensure future linear commit history: git remote set-url origin [email protected]:usnistgov/liboscal-java.git && pushd liboscal-java && git checkout --track origin/develop && git pull -r origin main.
  • Run the maven to prepare the release: git remote set-url origin [email protected]:usnistgov/liboscal-java.git && pushd liboscal-java && git checkout --track origin/develop && mvn release:clean release:prepare.
  • Once this is complete, sync remote state so develop will be pointing to the latest snapshot release and the new release tag (not a GitHub release yet): git checkout develop && git push --follow-tags
  • Once the tagged version is completed for the associated release, merge the tag and release prep into main branch to finish the release: git remote set-url origin [email protected]:usnistgov/liboscal-java.git && pushd liboscal-java && git checkout --track origin/main && git merge --ff-only v0x.y.z && git push origin HEAD.
  • Release automation in GitHub Actions will the build the snapshot release and final release in GitHub Actions.
  • Once complete review the appropriate release in Sonatype OSS repository and close it to prepare for promotion.
    image
  • Once steps complete, promote the closed release with the release action.
    image
  • Go to the releases section and create the release notes based on the new 0x.y.z tag.
  • Ensure develop branch is based off main for linear commits on future releases: git checkout develop && git pull -r origin main.
  • Communicate release to the community

Release Rollback Procedures

Sometimes a release doesn't go as planned or a change must be made before a release if finalized. In GitHub and our usage, a release must be associated with a tag, so we must delete the tag, remove commits, and re-release with the above in emergency situations.

  • Update the development environment on the target branch, likely develop: git remote set-url origin [email protected]:usnistgov/liboscal-java.git && git clone [email protected]:usnistgov/liboscal-java.git && pushd liboscal-java && git fetch --tags && git checkout --track origin/develop
  • Delete a pre-existing tag for the release to be rolled back: git remote set-url origin [email protected]:usnistgov/liboscal-java.git && git tag --delete vX.Y.Z && git push --delete origin vX.Y.Z
  • If necessary and you have made invalid commits with the Maven plugins that begin with [maven determine how many commits you must remove from the target branch to rollback the release. You will use this in the next step. Count the number of commits before, not including the commit you want to keep. That will be N below.
  • Remove commits from target branch, likely develop: git remote set-url origin [email protected]:usnistgov/liboscal-java.git && git checkout develop && git reset --hard origin/develop && git reset --hard HEAD~N # N is the number commits before the commit you keep, do not include it && git push origin HEAD -f
  • Re-run release procedures.
Clone this wiki locally