Skip to content

Commit 21cce76

Browse files
authored
chore: update release plz (#1362)
Signed-off-by: Todd Baert <[email protected]>
1 parent 4f47ff1 commit 21cce76

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/release-please.yml

+16-5
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,36 @@ on:
55
name: Run Release Please
66
jobs:
77
release-please:
8-
environment: publish
98
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write # for googleapis/release-please-action to create release commit
11+
pull-requests: write # for googleapis/release-please-action to create release PR
12+
issues: write # for googleapis/release-please-action to create labels
1013

1114
# Release-please creates a PR that tracks all changes
1215
steps:
1316
- uses: googleapis/release-please-action@v4
1417
id: release
1518
with:
1619
token: ${{secrets.RELEASE_PLEASE_ACTION_TOKEN}}
20+
outputs:
21+
release_created: ${{ steps.release.outputs.release_created }}
22+
release_tag_name: ${{ steps.release.outputs.tag_name }}
1723

24+
publish:
25+
environment: publish
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: read
29+
needs: release-please
30+
if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }}
31+
32+
steps:
1833
# The logic below handles the maven publication:
1934
- name: Checkout Repository
20-
if: ${{ steps.release.outputs.releases_created }}
2135
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2236

2337
- name: Set up JDK 21
24-
if: ${{ steps.release.outputs.releases_created }}
2538
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4
2639
with:
2740
java-version: '21'
@@ -32,7 +45,6 @@ jobs:
3245
server-password: OSSRH_PASSWORD
3346

3447
- name: Cache local Maven repository
35-
if: ${{ steps.release.outputs.releases_created }}
3648
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
3749
with:
3850
path: ~/.m2/repository
@@ -49,7 +61,6 @@ jobs:
4961

5062
# Release Please has already incremented versions and published tags, so we just need to publish (skip tests).
5163
- name: Maven Verify Deploy -DskipTests
52-
if: ${{ steps.release.outputs.releases_created }}
5364
# The nexus-staging-maven-plugin doesn't follow maven conventions. It stages all the projects with the last submodule: https://help.sonatype.com/repomanager2/staging-releases/configuring-your-project-for-deployment
5465
# This means there's no way to skip publishing of a particular module in a multi-module build, so we iterate over each module and publish them individually,
5566
# letting exists-maven-plugin skip the nexus-staging-maven-plugin's entire deploy goal if the artifact exists.

0 commit comments

Comments
 (0)