From 5d68d5d073b05ca02efcc40ec97c2f439271e81a Mon Sep 17 00:00:00 2001 From: Peter Sobot Date: Wed, 21 Jun 2023 15:37:16 -0400 Subject: [PATCH 1/4] Fix pom.xml to support deployments to Maven Central. --- java/pom.xml | 133 ++++++++++++++++++++++++++------------------------- 1 file changed, 69 insertions(+), 64 deletions(-) diff --git a/java/pom.xml b/java/pom.xml index d67044be..2811d54f 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -15,8 +15,10 @@ 1.2.2 + https://github.com/spotify/voyager + scm:git:git@github.com:spotify/voyager.git scm:git:git@github.com:spotify/voyager.git - v1.0.0 + HEAD @@ -27,6 +29,32 @@ + + + psobot + Peter Sobot + psobot@spotify.com + Spotify AB + http://www.spotify.com + + developer + + -5 + + + dylanrb123 + Dylan Bannon + dbannon@spotify.com + Spotify AB + http://www.spotify.com + + developer + + -5 + + + + 0.50 @@ -127,76 +155,53 @@ maven-release-plugin + + maven-source-plugin + 3.1.0 + + + attach-sources + + jar-no-fork + + + + org.apache.maven.plugins maven-javadoc-plugin 8 + + + attach-javadocs + + jar + + + - - - - - - tingle - - - - com.coveo - fmt-maven-plugin - - - - check - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - maven-checkstyle-plugin - - true - warning - - - - maven-enforcer-plugin - - - maven-failsafe-plugin - - - maven-release-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + - 8 + + --pinentry-mode + loopback + - - - - - - default - - true - - - - - - - + + + + + From b0fdf5b7867d3e546a9b146f5b98f801741d99b8 Mon Sep 17 00:00:00 2001 From: Peter Sobot Date: Wed, 21 Jun 2023 15:50:42 -0400 Subject: [PATCH 2/4] Add GPG key to all mvn invocations. --- .github/workflows/all.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 27a1a3d8..f174b970 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -60,12 +60,16 @@ jobs: with: java-version: ${{ matrix.java-version }} distribution: 'corretto' + gpg-private-key: ${{ secrets.SONATYPE_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE - uses: ilammy/msvc-dev-cmd@v1 if: runner.os == 'Windows' - name: Compile run: make - name: Run Tests run: mvn --batch-mode verify + env: + MAVEN_GPG_PASSPHRASE: ${{ secrets.SONATYPE_PASSPHRASE }} run-python-tests: runs-on: ${{ matrix.os }} @@ -264,12 +268,16 @@ jobs: with: java-version: ${{ matrix.java-version }} distribution: 'corretto' + gpg-private-key: ${{ secrets.SONATYPE_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE - uses: ilammy/msvc-dev-cmd@v1 if: runner.os == 'Windows' - name: Compile run: make - name: Package run: mvn --batch-mode package + env: + MAVEN_GPG_PASSPHRASE: ${{ secrets.SONATYPE_PASSPHRASE }} - uses: actions/upload-artifact@v3 with: if-no-files-found: error From caeb65bd3d59d0b60bafd80173ef1ecb76b262d7 Mon Sep 17 00:00:00 2001 From: Peter Sobot Date: Wed, 21 Jun 2023 16:01:28 -0400 Subject: [PATCH 3/4] Ignore sources and javadoc JARs when combining native libraries. --- .github/workflows/all.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index f174b970..96f6b7c7 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -296,6 +296,8 @@ jobs: shell: bash working-directory: artifacts run: | + rm *-sources.jar + rm *-javadoc.jar for artifact in java-*; do unzip -o $artifact/*.jar -d combined-jar; done zip -r $(ls java-* | grep jar | tail -n 1) combined-jar/* - uses: actions/upload-artifact@v3 From bbb75c2bf39eb92a7975e7764eb8588cca86decd Mon Sep 17 00:00:00 2001 From: Peter Sobot Date: Wed, 21 Jun 2023 16:08:41 -0400 Subject: [PATCH 4/4] Delete sources and javadoc JARs properly. --- .github/workflows/all.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 96f6b7c7..16325f6d 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -296,8 +296,8 @@ jobs: shell: bash working-directory: artifacts run: | - rm *-sources.jar - rm *-javadoc.jar + rm -fv java-*/*-sources.jar + rm -fv java-*/*-javadoc.jar for artifact in java-*; do unzip -o $artifact/*.jar -d combined-jar; done zip -r $(ls java-* | grep jar | tail -n 1) combined-jar/* - uses: actions/upload-artifact@v3