diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2bdd1e1ac7..efa8e0cbbe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,6 @@ on: push: tags: - "*" - - "!*-rc*" - "!*.pr*" - "!*b" @@ -18,10 +17,14 @@ jobs: runs-on: "ubuntu-20.04" env: JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1" + TAG: ${{ github.ref_name }} outputs: hash: ${{ steps.hash.outputs.hash }} artifact_name: ${{ steps.hash.outputs.artifact_name }} steps: + - name: Validate version name + run: | + [[ $TAG =~ jackson-core-[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)? ]] || exit 1 - uses: actions/checkout@v3 - name: Set up JDK uses: actions/setup-java@v3 @@ -29,7 +32,7 @@ jobs: distribution: "temurin" java-version: "8" cache: "maven" - server-id: sonatype-nexus-snapshots + server-id: sonatype-nexus-staging server-username: CI_DEPLOY_USERNAME server-password: CI_DEPLOY_PASSWORD # See https://github.com/actions/setup-java/blob/v2/docs/advanced-usage.md#Publishing-using-Apache-Maven diff --git a/release.sh b/release.sh index a88c3fc550..a67eee5e79 100755 --- a/release.sh +++ b/release.sh @@ -1,16 +1,16 @@ #!/bin/bash -# This script simulates the Maven Release Plugin, but only performs release:clean and -# release:prepare. The release:perform step is handled by the CI when the tag is -# pushed. +# This script simulates the Maven Release Plugin, but only performs +# release:clean and release:prepare. The release:perform step is handled by the +# CI when the tag is pushed. # # However, release:perform on Git requires the release.properties file. We must -# therefore modify the first commit created by release:prepare to include this file, and -# then delete the file in the second commit. +# therefore modify the first commit created by release:prepare to include this +# file, and then delete the file in the second commit. # -# This will ensure that release.properties is available to release:perform in the CI, -# while keeping with the expectation that this file does not get commited (long-term) to -# the repository. +# This will ensure that release.properties is available to release:perform in +# the CI, while keeping with the expectation that this file does not get +# commited (long-term) to the repository. set -euo pipefail @@ -21,7 +21,7 @@ set -euo pipefail git reset HEAD~1 # delete tag created by release:prepare -tag_name=$(git tag --points-at) +tag_name="$(git tag --points-at)" git tag -d "$tag_name" # Add release.properties to that commit @@ -31,7 +31,8 @@ git commit --amend --no-edit # recreate tag git tag "$tag_name" -m "[maven-release-plugin] copy for tag $tag_name" -# Recreate second commit, removing release.properties from the repository +# Recreate second commit (from release to SNAPSHOT), removing +# release.properties from the repository git rm release.properties git add pom.xml git commit -m "[maven-release-plugin] prepare for next development iteration" @@ -40,4 +41,5 @@ git commit -m "[maven-release-plugin] prepare for next development iteration" git push git push origin "$tag_name" +# clean up rm pom.xml.releaseBackup