@@ -12,25 +12,34 @@ permissions: # added using https://github.com/step-security/secure-workflows
12
12
13
13
jobs :
14
14
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
19
15
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
20
20
21
21
# Release-please creates a PR that tracks all changes
22
22
steps :
23
23
- uses : googleapis/release-please-action@v4
24
24
id : release
25
25
with :
26
26
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
27
29
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
31
40
uses : actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
41
+
32
42
- name : Set up JDK 17
33
- if : ${{ steps.release.outputs.release_created }}
34
43
uses : actions/setup-java@f4f1212c880fdec8162ea9a6493f4495191887b4
35
44
with :
36
45
java-version : ' 17'
@@ -41,17 +50,15 @@ jobs:
41
50
server-password : ${{ secrets.OSSRH_PASSWORD }}
42
51
43
52
- name : Configure GPG Key
44
- if : ${{ steps.release.outputs.release_created }}
45
53
run : |
46
54
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
47
55
env :
48
56
GPG_SIGNING_KEY : ${{ secrets.GPG_SIGNING_KEY }}
49
57
50
58
- name : Deploy
51
- if : ${{ steps.release.outputs.release_created }}
52
59
run : |
53
60
mvn --batch-mode \
54
- --settings release/m2-settings.xml clean deploy
61
+ --settings release/m2-settings.xml -DskipTests clean deploy
55
62
env :
56
63
OSSRH_USERNAME : ${{ secrets.OSSRH_USERNAME }}
57
64
OSSRH_PASSWORD : ${{ secrets.OSSRH_PASSWORD }}
0 commit comments