Skip to content

Commit 1714efe

Browse files
toddbaertchrfwow
andauthored
chore: improvements to release workflow (#1451)
Signed-off-by: Todd Baert <[email protected]> Co-authored-by: chrfwow <[email protected]>
1 parent d9a72d2 commit 1714efe

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,34 @@ permissions: # added using https://github.com/step-security/secure-workflows
1212

1313
jobs:
1414
release-please:
15-
environment: publish
16-
permissions:
17-
contents: write # for google-github-actions/release-please-action to create release commit
18-
pull-requests: write # for google-github-actions/release-please-action to create release PR
1915
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write # for googleapis/release-please-action to create release commit
18+
pull-requests: write # for googleapis/release-please-action to create release PR
19+
issues: write # for googleapis/release-please-action to create labels
2020

2121
# Release-please creates a PR that tracks all changes
2222
steps:
2323
- uses: googleapis/release-please-action@v4
2424
id: release
2525
with:
2626
token: ${{secrets.RELEASE_PLEASE_ACTION_TOKEN}}
27+
outputs:
28+
release_created: ${{ fromJSON(steps.release.outputs.paths_released)[0] != null }} # if we have a single release path, do the release
2729

28-
# These steps are only run if this was a merged release-please PR
29-
- name: checkout
30-
if: ${{ steps.release.outputs.release_created }}
30+
publish:
31+
environment: publish
32+
runs-on: ubuntu-latest
33+
permissions:
34+
contents: read
35+
needs: release-please
36+
if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }}
37+
38+
steps:
39+
- name: Checkout Repository
3140
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
41+
3242
- name: Set up JDK 17
33-
if: ${{ steps.release.outputs.release_created }}
3443
uses: actions/setup-java@f4f1212c880fdec8162ea9a6493f4495191887b4
3544
with:
3645
java-version: '17'
@@ -41,17 +50,15 @@ jobs:
4150
server-password: ${{ secrets.OSSRH_PASSWORD }}
4251

4352
- name: Configure GPG Key
44-
if: ${{ steps.release.outputs.release_created }}
4553
run: |
4654
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
4755
env:
4856
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
4957

5058
- name: Deploy
51-
if: ${{ steps.release.outputs.release_created }}
5259
run: |
5360
mvn --batch-mode \
54-
--settings release/m2-settings.xml clean deploy
61+
--settings release/m2-settings.xml -DskipTests clean deploy
5562
env:
5663
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
5764
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

0 commit comments

Comments
 (0)