diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml index 2a89ff6..d58a5b9 100644 --- a/.github/workflows/stage.yml +++ b/.github/workflows/stage.yml @@ -12,7 +12,7 @@ on: default: true type: boolean publish_maven: - description: 'Create Maven bundle' + description: 'Create Maven release' default: true type: boolean skip_validation: @@ -30,6 +30,11 @@ jobs: with: java-version: 17 distribution: temurin + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE - name: Install required software run: | sudo apt install xmlstarlet @@ -45,36 +50,14 @@ jobs: run: | [ "${{ inputs.version }}" == "${BUILD_VERSION}" ] || (>&2 echo "Version does not match value in pom.xml"; exit -1) [ "${{ inputs.version }}" == "$(cat README.md | grep -m 1 '' | tr -d '<>/[:alpha:][:space:]')" ] || (>&2 echo "Version does not match value in README.md"; exit -1) - - name: Build artifact - run: mvn package javadoc:jar - - name: Sign Maven artifacts and create bundle + - name: Build and stage Maven artifacts if: ${{ inputs.publish_maven }} run: | - echo -n "${GPG_SIGNING_KEY}" | base64 --decode | gpg --import - - mkdir maven - cp pom.xml maven/${BUILD_ARTIFACT}.pom - cp target/${BUILD_ARTIFACT}.jar maven/ - cp target/${BUILD_ARTIFACT}-sources.jar maven/ - cp target/${BUILD_ARTIFACT}-javadoc.jar maven/ - [ -f "target/${BUILD_ARTIFACT}-jar-with-dependencies.jar" ] && cp target/${BUILD_ARTIFACT}-jar-with-dependencies.jar maven/ - - pushd maven - gpg -ab ${BUILD_ARTIFACT}.pom - gpg -ab ${BUILD_ARTIFACT}.jar - gpg -ab ${BUILD_ARTIFACT}-sources.jar - gpg -ab ${BUILD_ARTIFACT}-javadoc.jar - [ -f "${BUILD_ARTIFACT}-jar-with-dependencies.jar" ] && gpg -ab ${BUILD_ARTIFACT}-jar-with-dependencies.jar - - jar -cvf ${BUILD_ARTIFACT}-bundle.jar * + mvn --batch-mode deploy env: - GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} - - name: Upload Maven bundle - if: ${{ inputs.publish_maven }} - uses: actions/upload-artifact@v4 - with: - name: Maven bundle - path: maven/*-bundle.jar + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - name: Stage GitHub release if: ${{ inputs.publish_github }} run: | diff --git a/README.md b/README.md index 5261690..d12346e 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Add the following dependency to your `pom.xml`: org.moeaframework pisa-plugin - 2.0.0 + 2.0.1 ``` @@ -27,7 +27,7 @@ MOEA Framework, use the table below to identify which version of this plugin to MOEA Framework Version | Compatible PISA-Plugin Version ---------------------- | ------------------------------ -**`>= 4.0`** | **`2.0.0`** +**`>= 4.0`** | **`>= 2.0.0`** `>= 3.8` | `1.0.3` `3.7` | `1.0.2` `<= 3.6` | Not available diff --git a/pom.xml b/pom.xml index d8ffa0d..07fe974 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.moeaframework pisa-plugin - 2.0.0 + 2.0.1 jar PISA Plugin for the MOEA Framework @@ -39,7 +39,7 @@ org.moeaframework moeaframework - 4.1 + 4.3 provided @@ -55,28 +55,100 @@ org.apache.maven.plugins maven-jar-plugin - 3.3.0 + 3.4.2 org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.3.1 attach-sources + deploy - jar + jar-no-fork - + org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.7.0 + + + attach-javadocs + deploy + + jar + + + + + + -Xdoclint:none + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.4 + + + sign-artifacts + deploy + + sign + + + + --pinentry-mode + loopback + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.2 + + true + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.7.0 + + + nexus-deploy + deploy + + deploy + + + + + https://oss.sonatype.org/ + ossrh + + + + + ossrh + Nexus Staging Repository + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + +