From f059e0108ca588c153e99305f408522d59a6b6ad Mon Sep 17 00:00:00 2001 From: Breno A Date: Wed, 17 Jan 2024 01:14:04 -0300 Subject: [PATCH] Update maven-publish.yml --- .github/workflows/maven-publish.yml | 33 +++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 0451035..c7c5423 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -14,16 +14,31 @@ jobs: with: java-version: '11' distribution: 'temurin' - - id: install-secret-key - name: Install gpg secret key - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + java-package: 'jdk' + cache: 'maven' + server-id: ossrh + - name: Import GPG Key + uses: crazy-max/ghaction-import-gpg@v5.0.0 + with: + gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} + + - name: Release With Maven run: | - cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import - gpg --list-secret-keys --keyid-format LONG - - name: Publish package - run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} deploy + mvn -B -U \ + -Pci-cd \ + release:prepare \ + release:perform \ + javadoc:jar \ + source:jar \ + -s settings.xml \ + -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \ + -DreleaseVersion=${{ github.event.inputs.releaseVersion }} \ + -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} \ + deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} publish-javadoc: runs-on: ubuntu-latest