Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: associate a commit with beta release #5530

Merged
34 changes: 31 additions & 3 deletions chore/release-beta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,45 @@ echo "NEW_BETA_NUMBER $NEW_BETA_NUMBER"
NEXT_VERSION="$CURRENT_VERSION-beta-$NEW_BETA_NUMBER"
echo "::endgroup::"

echo "::group::Setting release version"
BRANCH_NAME="beta-release/$NEXT_VERSION"

echo "::group::Setting beta-release version"
mvn -f spoon-pom --no-transfer-progress --batch-mode versions:set -DnewVersion="$NEXT_VERSION" -DprocessAllModules
mvn --no-transfer-progress --batch-mode versions:set -DnewVersion="$NEXT_VERSION" -DprocessAllModules
mvn -f spoon-javadoc --no-transfer-progress --batch-mode versions:set -DnewVersion="$NEXT_VERSION" -DprocessAllModules
echo "::endgroup::"

echo "::group::Staging release"
echo "::group::Commit & Push changes"
git checkout -b "$BRANCH_NAME"
git commit -am "release: Releasing version $NEXT_VERSION"
git push --set-upstream origin "$BRANCH_NAME"
echo "::endgroup::"

echo "::group::Staging beta-release"
mvn -f spoon-pom --no-transfer-progress --batch-mode -Pjreleaser clean deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy
mvn --no-transfer-progress --batch-mode -Pjreleaser deploy:deploy-file -Dfile="./spoon-pom/pom.xml" -DpomFile="./spoon-pom/pom.xml" -Durl="file://$(mvn help:evaluate -D"expression=project.basedir" -q -DforceStdout)/target/staging-deploy"
echo "::endgroup::"

echo "::group::Running jreleaser"
JRELEASER_PROJECT_VERSION="$NEXT_VERSION" jreleaser-cli deploy
JRELEASER_PROJECT_VERSION="$NEXT_VERSION" jreleaser-cli release
echo "::endgroup::"

# We reset the version to the current snapshot version
SNAPSHOT_VERSION_TO_RESET_TO=$CURRENT_VERSION_WITH_SNAPSHOT

echo "::group::Updating poms to next target version"
mvn -f spoon-pom --no-transfer-progress --batch-mode versions:set -DnewVersion="$SNAPSHOT_VERSION_TO_RESET_TO" -DprocessAllModules
mvn --no-transfer-progress --batch-mode versions:set -DnewVersion="$SNAPSHOT_VERSION_TO_RESET_TO" -DprocessAllModules
mvn -f spoon-javadoc --no-transfer-progress --batch-mode versions:set -DnewVersion="$SNAPSHOT_VERSION_TO_RESET_TO" -DprocessAllModules
echo "::endgroup::"

echo "::group::Committing changes"
git commit -am "release: Setting SNAPSHOT version back to $SNAPSHOT_VERSION_TO_RESET_TO"
git push --set-upstream origin "$BRANCH_NAME"
echo "::endgroup::"

echo "::group::Merging into master (fast-forward)"
git checkout master
git merge --ff-only "$BRANCH_NAME"
git push origin master
I-Al-Istannen marked this conversation as resolved.
Show resolved Hide resolved
echo "::endgroup::"