11on :
2+ workflow_dispatch :
23 push :
34 tags :
45 - ' [0-9]+.[0-9]+.[0-9]+*'
@@ -9,14 +10,62 @@ permissions: {}
910
1011jobs :
1112 release_maven :
13+ permissions :
14+ contents : write
15+ actions : write
16+ id-token : write
17+
18+ name : Build and release
19+
20+ runs-on : ubuntu-latest
21+
22+ steps :
23+ - name : Checkout
24+ uses : actions/checkout@v4
25+
26+ - name : Setup Java
27+ uses : actions/setup-java@v4
28+ with :
29+ distribution : ' temurin'
30+ java-version : ' 11'
31+
32+ - name : Setup Node
33+ uses : actions/setup-node@v4
34+ with :
35+ node-version : " 18"
36+
37+ - run : scripts/setup-signing-key.sh
38+ env :
39+ DECRYPTER : ${{ secrets.DECRYPTER }}
40+ SIGNING_KEY : ${{ secrets.SIGNING_KEY }}
41+ PASSPHRASE : ${{ secrets.PASSPHRASE }}
42+ GRADLE_PUBLISH_KEY : ${{ secrets.GRADLE_PUBLISH_KEY }}
43+ GRADLE_PUBLISH_SECRET : ${{ secrets.GRADLE_PUBLISH_SECRET }}
44+ - name : Build and Release
45+ run : export VERSION="1.0.0-`date '+%Y%m%d%H%M%S'`"; ./gradlew -Pversion=$VERSION clean check publishMavenPublicationToSonatype closeAndReleaseSonatypeStagingRepository writeVersionToReadme
46+ env :
47+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
48+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
49+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50+
51+ - uses : stefanzweifel/git-auto-commit-action@v4.6.0
52+ with :
53+ file_pattern : " scripts/install.sh"
54+ commit_message : " TASK: Updating version in README"
55+ commit_user_name : Auto Mation
56+ commit_user_email : automation@commercetools.com
57+ commit_author : Auto Mation <automation@commercetools.com>
58+
59+ release_tag :
1260 permissions :
1361 id-token : write
1462 contents : read
1563
1664 name : Build and release to Maven
65+ if : startsWith( github.ref, 'refs/tags/')
1766
1867 runs-on : ubuntu-latest
19-
68+ needs : [release_maven]
2069 steps :
2170 - name : Checkout
2271 uses : actions/checkout@v4
@@ -71,9 +120,10 @@ jobs:
71120 run : npm version minor && npm publish --no-git-tag-version
72121
73122 bump_version :
123+ if : startsWith( github.ref, 'refs/tags/')
74124 name : Bump NPM version
75125
76- needs : [release_maven ]
126+ needs : [release_tag ]
77127 runs-on : ubuntu-latest
78128
79129 permissions :
0 commit comments