1- name : Publish
1+ # Copyright 2026 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.
214
315on :
4- release :
5- types : [published]
16+ push :
17+ branches :
18+ - main
19+
20+ permissions :
21+ contents : write
22+ pull-requests : write
23+
24+ name : release-please
625
726jobs :
8- publish :
27+ release-please :
928 runs-on : ubuntu-latest
1029 steps :
11- - name : Checkout
12- uses : actions/checkout@v5
30+ - uses : googleapis/release-please-action@v4
1331 with :
1432 token : ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
15-
16- - uses : gradle/actions/wrapper-validation@v4
17-
18- - name : Set up JDK 21
19- uses : actions/setup-java@v4.7.1
20- with :
21- java-version : ' 21'
22- distribution : ' adopt'
23-
24- - name : Create .gpg key
25- run : |
26- echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc
27- gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc
28-
29- echo "Build and publish"
30- sed -i -e "s,mavenCentralUsername=,mavenCentralUsername=$SONATYPE_TOKEN_USERNAME,g" gradle.properties
31- SONATYPE_TOKEN_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_TOKEN_PASSWORD" | sed -e 's/[\/&]/\\&/g')
32- sed -i -e "s,mavenCentralPassword=,mavenCentralPassword=$SONATYPE_TOKEN_PASSWORD_ESCAPED,g" gradle.properties
33- sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties
34- sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties
35- sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties
36-
37- env :
38- GPG_KEY_ARMOR : ${{ secrets.SYNCED_GPG_KEY_ARMOR }}
39- 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 }}
43-
44- - name : Publish to MavenCentral
45- run : ./gradlew publishToMavenCentral --warn --stacktrace
33+ config-file : release-please-config.json
34+ manifest-file : .release-please-manifest.json
0 commit comments