From 31c281fd1eaff45d03b5cc461ec31a2d43728508 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Thu, 3 Nov 2022 16:21:57 +0100 Subject: [PATCH 1/2] build: fix version number of distribution module --- distribution/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/pom.xml b/distribution/pom.xml index ea539c380..b442fde39 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -5,7 +5,7 @@ rewrite-parent org.ocpsoft.rewrite - 4.0.0-SNAPSHOT + 6.0.0-SNAPSHOT ../ From a753f56eb77104e9b47e50c1d36c075c33438516 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Thu, 3 Nov 2022 16:23:10 +0100 Subject: [PATCH 2/2] build,ci: add release pipeline for tags - Adding a Maven profile to activate signing packages, and creating source + javadoc JARs for upload - Add CD pipeline based on Github Action using the Maven profile and using a GPG key from Github Secrets - Runs on tags pushed to the repo --- .github/workflows/maven-release.yml | 40 ++++++++++++++++++++++ pom.xml | 53 ++++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/maven-release.yml diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml new file mode 100644 index 000000000..a579d6023 --- /dev/null +++ b/.github/workflows/maven-release.yml @@ -0,0 +1,40 @@ +name: Release to Maven Central Repository +on: + push: + tags: + - '*' +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' + + - name: Build, test, verify + run: mvn -B verify + - name: Check POM metadata for release + run: mvn pomchecker:check-maven-central + + # Running setup-java again overwrites the settings.xml - IT'S MANDATORY TO DO THIS SECOND SETUP!!! + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Sign + Publish release + run: mvn -Prelease deploy -DskipTests + env: + MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index b8868f315..6c6102956 100644 --- a/pom.xml +++ b/pom.xml @@ -28,6 +28,7 @@ 11 17.0.0 + none true @@ -67,7 +68,7 @@ 3.1.0 1.3.0 3.0.1 - 1.3.0 + 1.4.0 1.6.13 @@ -585,6 +586,56 @@ + + release + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + ${maven.compiler.release} + false + ${maven.javadoc.lint} + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + + + WILDFLY_MANAGED