Skip to content

Commit

Permalink
chore: Setup java only once and then build and deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
en-milie committed Nov 22, 2024
1 parent a6527c7 commit 67424d3
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions .github/workflows/release-to-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,25 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 21
- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 21
java-version: '21'
server-id: central
server-username: ${{ secrets.OSSRH_USERNAME}}
server-password: ${{ secrets.OSSRH_PASSWORD }}
gpg-private-key: ${{ secrets.GPG_SIGN_KEY }}
gpg-passphrase: ${{ secrets.GPG_SIGN_PASSPHRASE }}

- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}"

- name: Build with Maven
run: |
mvn -B clean --file pom.xml
mvn -B package --file pom.xml -DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
server-id: central
server-username: ${{ secrets.OSSRH_USERNAME}}
server-password: ${{ secrets.OSSRH_PASSWORD }}
gpg-private-key: ${{ secrets.GPG_SIGN_KEY }}
gpg-passphrase: ${{ secrets.GPG_SIGN_PASSPHRASE }}

- name: Publish to Apache Maven Central
run: mvn -B deploy -Psign --file pom.xml
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME}}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGN_PASSPHRASE }}
run: mvn -B deploy -Psign --file pom.xml

0 comments on commit 67424d3

Please sign in to comment.