Skip to content

Commit e35f4a9

Browse files
authored
Update release.yml
Set up sonatype credentials, and push the tag after `mvn deploy` in case the build fails
1 parent 71dd2a3 commit e35f4a9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
java-version: 17
3232
distribution: 'zulu'
3333
cache: 'maven'
34+
server-id: sonatype-nexus-staging
35+
server-username: CI_DEPLOY_USERNAME
36+
server-password: CI_DEPLOY_PASSWORD
3437

3538
- name: Bump Version Number
3639
run: |
@@ -43,11 +46,17 @@ jobs:
4346
git tag "v${{ github.event.inputs.version }}"
4447
echo "TARGET_COMMITISH=$(git rev-parse HEAD)" >> $GITHUB_ENV
4548
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/google/google-java-format.git
46-
git push origin "v${{ github.event.inputs.version }}"
4749
4850
- name: Build Jars
51+
env:
52+
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
53+
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
4954
run: mvn --no-transfer-progress -P sonatype-oss-release clean deploy -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}"
5055

56+
- name: Push tag
57+
run: |
58+
git push origin "v${{ github.event.inputs.version }}"
59+
5160
- name: Add Jars to Release Entry
5261
uses: softprops/[email protected]
5362
with:

0 commit comments

Comments
 (0)