Skip to content

Commit

Permalink
- Use Make step rather than mvn directly for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
nwithan8 committed Jul 30, 2024
1 parent 2119531 commit a634645
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit a634645

Please sign in to comment.