diff --git a/.github/workflows/version-and-release.yaml b/.github/workflows/version-and-release.yaml
index 93ee19348b..6fbbb122c8 100644
--- a/.github/workflows/version-and-release.yaml
+++ b/.github/workflows/version-and-release.yaml
@@ -10,17 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- - name: 1. Checkout sources
+ - name: Checkout sources
uses: actions/checkout@v4
- - name: 2. Extract version from tag
- id: get_version
- run: |
- realversion="${GITHUB_REF/refs\/tags\//}"
- realversion="${realversion//v/}"
- echo "VERSION=$realversion" >> $GITHUB_OUTPUT
-
- - name: 3. Set up Java with Maven cache
+ - name: Set up Java with Maven cache
uses: actions/setup-java@v4
with:
java-version: '8'
@@ -30,20 +23,23 @@ jobs:
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- - name: 4. Update version in Maven configuration
- run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}
+ - name: Update version in Maven configuration
+ run: |
+ mvn --no-transfer-progress \
+ --batch-mode \
+ versions:set -DnewVersion=${{ github.event.release.tag_name }}
- - name: 5. Install GPG key
+ - name: Install GPG key
run: |
cat <(echo -e "${{ secrets.OSSH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- - name: 6. Publish to Maven
+ - name: Publish to Maven
run: |
mvn --no-transfer-progress \
--batch-mode \
-Dgpg.passphrase='${{ secrets.OSSH_GPG_SECRET_KEY_PASSWORD }}' \
- release:perform
+ deploy -P sonatype-oss-release
env:
MAVEN_USERNAME: ${{secrets.OSSH_USERNAME}}
MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}}
diff --git a/pom.xml b/pom.xml
index 9be9d982f7..a2642124ab 100644
--- a/pom.xml
+++ b/pom.xml
@@ -604,6 +604,18 @@
3.0.1
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ 1.6.13
+ true
+
+ ossrh
+ https://oss.sonatype.org/
+ true
+
+
+
org.apache.maven.plugins
maven-surefire-plugin