From a634645593c74ff7537f1dd5a4bb8541213b8a5b Mon Sep 17 00:00:00 2001 From: Nate Harris Date: Tue, 30 Jul 2024 14:16:55 -0600 Subject: [PATCH] - Use Make step rather than mvn directly for deploy --- .github/workflows/publish.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8d2b0e2b..a0cebd47 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,7 +4,7 @@ # Secrets required: # - MAVEN_USERNAME: Username for Maven Central Repository # - MAVEN_CENTRAL_TOKEN: Token/password for Maven Central Repository -# - MAVEN_GPG_PRIVATE_KEY: GPG private key to sign the artifacts +# - MAVEN_GPG_PRIVATE_KEY: GPG private key to sign the artifacts (string) # - MAVEN_GPG_PASSPHRASE: Passphrase for the GPG private key name: Publish library to Maven Central Repository @@ -38,19 +38,14 @@ jobs: distribution: "zulu" java-version: "22" # Always use the latest JDK server-id: "ossrh" - server-username: MAVEN_USERNAME # env variable for username in deploy - server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import - gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - - - name: Install dependencies - run: make install - - - name: Build with Maven - run: mvn -B package --file pom.xml - - - name: Publish to Apache Maven Central - run: mvn deploy + # define environmental variable names + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Clean, build and publish to Apache Maven Central + run: make publish pass=${{ secrets.MAVEN_GPG_PASSPHRASE }} env: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}