From e35f4a9db0f0ed0c4e9d0502ca2592b1abafc7cc Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Wed, 9 Feb 2022 11:25:34 -0800 Subject: [PATCH] Update release.yml Set up sonatype credentials, and push the tag after `mvn deploy` in case the build fails --- .github/workflows/release.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 09cd08048..c18d40c7a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,9 @@ jobs: java-version: 17 distribution: 'zulu' cache: 'maven' + server-id: sonatype-nexus-staging + server-username: CI_DEPLOY_USERNAME + server-password: CI_DEPLOY_PASSWORD - name: Bump Version Number run: | @@ -43,11 +46,17 @@ jobs: git tag "v${{ github.event.inputs.version }}" echo "TARGET_COMMITISH=$(git rev-parse HEAD)" >> $GITHUB_ENV git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/google/google-java-format.git - git push origin "v${{ github.event.inputs.version }}" - name: Build Jars + env: + CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} + CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} run: mvn --no-transfer-progress -P sonatype-oss-release clean deploy -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" + - name: Push tag + run: | + git push origin "v${{ github.event.inputs.version }}" + - name: Add Jars to Release Entry uses: softprops/action-gh-release@v0.1.14 with: