diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 610e814..d5bb34c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,37 +15,19 @@ jobs: cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import # Verify gpg secret key gpg --list-secret-keys --keyid-format LONG - gpg --armor --export-secret-keys ${{ secrets.OSSRH_GPG_SECRET_KEY }} > gpg_key.asc - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Set up Maven Central Repository - uses: actions/setup-java@v3 + uses: actions/setup-java@v1 with: java-version: '11' - distribution: 'adopt' server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} - gpg-passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} - - name: build artifact - run: mvn clean package + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Deploy with Maven + run: mvn -B clean deploy -Pci-cd env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} - GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD } - - name: Create release - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: "${{ github.workspace }}/target/*.jar" - - name: Publish to the Maven Central Repository - run: | - mvn \ - --no-transfer-progress \ - --batch-mode \ - deploy - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}