1- # Copyright 2020 Google LLC
2- #
3- # Licensed under the Apache License, Version 2.0 (the "License");
4- # you may not use this file except in compliance with the License.
5- # You may obtain a copy of the License at
6- #
7- # http://www.apache.org/licenses/LICENSE-2.0
8- #
9- # Unless required by applicable law or agreed to in writing, software
10- # distributed under the License is distributed on an "AS IS" BASIS,
11- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12- # See the License for the specific language governing permissions and
13- # limitations under the License.
1+ name : Publish
142
15- name : Release
163on :
17- push :
18- branches : [ main ]
19- workflow_dispatch :
4+ release :
5+ types : [published]
206
217jobs :
22- release :
8+ publish :
239 runs-on : ubuntu-latest
2410 steps :
2511 - name : Checkout
2612 uses : actions/checkout@v5
2713 with :
2814 token : ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
15+
2916 - uses : gradle/actions/wrapper-validation@v4
17+
3018 - name : Set up JDK 21
31- uses : actions/setup-java@v4.6.0
19+ uses : actions/setup-java@v4.7.1
3220 with :
3321 java-version : ' 21'
3422 distribution : ' adopt'
35- - name : Set up Gradle Publishing Environment Variables
23+
24+ - name : Create .gpg key
3625 run : |
3726 echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc
3827 gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc
@@ -46,28 +35,11 @@ jobs:
4635 sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties
4736
4837 env :
49- SONATYPE_TOKEN_USERNAME : ${{ secrets.SONATYPE_TOKEN }}
50- SONATYPE_TOKEN_PASSWORD : ${{ secrets.SONATYPE_TOKEN_PASSWORD }}
5138 GPG_KEY_ARMOR : ${{ secrets.SYNCED_GPG_KEY_ARMOR }}
52- GPG_PASSWORD : ${{ secrets.SYNCED_GPG_KEY_PASSWORD }}
5339 GPG_KEY_ID : ${{ secrets.SYNCED_GPG_KEY_ID }}
40+ GPG_PASSWORD : ${{ secrets.SYNCED_GPG_KEY_PASSWORD }}
41+ SONATYPE_TOKEN_PASSWORD : ${{ secrets.SONATYPE_TOKEN_PASSWORD }}
42+ SONATYPE_TOKEN_USERNAME : ${{ secrets.SONATYPE_TOKEN }}
5443
55- - uses : actions/setup-node@v4
56- with :
57- node-version : ' 14'
58-
59- - name : Install conventionalcommits
60- run : npm i -D conventional-changelog-conventionalcommits
61-
62- - name : Semantic Release
63- 64- with :
65- extra_plugins : |
66- "@semantic-release/[email protected] " 67- "@semantic-release/[email protected] " 68- 69- "@semantic-release/[email protected] " 70- "@semantic-release/[email protected] " 71- "@semantic-release/[email protected] " 72- env :
73- GH_TOKEN : ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
44+ - name : Publish to MavenCentral
45+ run : ./gradlew publishToMavenCentral --warn --stacktrace
0 commit comments