Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
Set up sonatype credentials, and push the tag after `mvn deploy` in case the build fails
  • Loading branch information
cushon authored Feb 9, 2022
1 parent 71dd2a3 commit e35f4a9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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:
Expand Down

0 comments on commit e35f4a9

Please sign in to comment.