diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml index d58a5b9..2a89ff6 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 release' + description: 'Create Maven bundle' default: true type: boolean skip_validation: @@ -30,11 +30,6 @@ 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 @@ -50,14 +45,36 @@ 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 and stage Maven artifacts + - name: Build artifact + run: mvn package javadoc:jar + - name: Sign Maven artifacts and create bundle if: ${{ inputs.publish_maven }} run: | - mvn --batch-mode deploy + 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 * env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + 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 - name: Stage GitHub release if: ${{ inputs.publish_github }} run: | diff --git a/README.md b/README.md index d12346e..5261690 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.1 + 2.0.0 ``` @@ -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 07fe974..d8ffa0d 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.moeaframework pisa-plugin - 2.0.1 + 2.0.0 jar PISA Plugin for the MOEA Framework @@ -39,7 +39,7 @@ org.moeaframework moeaframework - 4.3 + 4.1 provided @@ -55,100 +55,28 @@ org.apache.maven.plugins maven-jar-plugin - 3.4.2 + 3.3.0 org.apache.maven.plugins maven-source-plugin - 3.3.1 + 3.3.0 attach-sources - deploy - - jar-no-fork - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 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 - + maven-javadoc-plugin + 3.5.0 - - - - ossrh - Nexus Staging Repository - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - -