Skip to content

Commit fa2497b

Browse files
authored
build: introduced release-please (#1646)
* build: introduced release-please * build: header * build: release simple * build: release simple
1 parent 60adcde commit fa2497b

File tree

6 files changed

+93
-99
lines changed

6 files changed

+93
-99
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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.
14+
15+
name: release-please
16+
17+
on:
18+
push:
19+
branches:
20+
- main
21+
22+
permissions:
23+
contents: write
24+
pull-requests: write
25+
26+
jobs:
27+
release-please:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: googleapis/release-please-action@v4
31+
id: release
32+
with:
33+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
34+
35+
# The steps below only run when a release PR is merged and a GitHub release is created
36+
- name: Checkout
37+
if: ${{ steps.release.outputs.release_created }}
38+
uses: actions/checkout@v6
39+
40+
- name: Set up JDK 17
41+
if: ${{ steps.release.outputs.release_created }}
42+
uses: actions/setup-java@v5
43+
with:
44+
java-version: '17'
45+
distribution: 'temurin'
46+
47+
- uses: gradle/actions/setup-gradle@v4
48+
if: ${{ steps.release.outputs.release_created }}
49+
50+
- name: Set up Gradle Publishing Environment Variables
51+
if: ${{ steps.release.outputs.release_created }}
52+
run: |
53+
echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc
54+
gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc
55+
56+
echo "Build and publish"
57+
sed -i -e "s,mavenCentralUsername=,mavenCentralUsername=$SONATYPE_TOKEN_USERNAME,g" gradle.properties
58+
SONATYPE_TOKEN_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_TOKEN_PASSWORD" | sed -e 's/[\/&]/\\&/g')
59+
sed -i -e "s,mavenCentralPassword=,mavenCentralPassword=$SONATYPE_TOKEN_PASSWORD_ESCAPED,g" gradle.properties
60+
sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties
61+
sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties
62+
sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties
63+
env:
64+
GPG_KEY_ARMOR: ${{ secrets.SYNCED_GPG_KEY_ARMOR }}
65+
GPG_KEY_ID: ${{ secrets.SYNCED_GPG_KEY_ID }}
66+
GPG_PASSWORD: ${{ secrets.SYNCED_GPG_KEY_PASSWORD }}
67+
SONATYPE_TOKEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }}
68+
SONATYPE_TOKEN_USERNAME: ${{ secrets.SONATYPE_TOKEN }}
69+
70+
- name: Build and Publish
71+
if: ${{ steps.release.outputs.release_created }}
72+
run: |
73+
./gradlew build --warn --stacktrace
74+
./gradlew publishToMavenCentral --warn --stacktrace --debug --info
75+
env:
76+
GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}

.github/workflows/release.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "3.20.1"
3+
}

.releaserc

Lines changed: 0 additions & 30 deletions
This file was deleted.

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@ tasks.register<Delete>("clean") {
3737

3838
allprojects {
3939
group = "com.google.maps.android"
40+
// {x-release-please-start-version}
4041
version = "3.20.1"
42+
// {x-release-please-end}
4143
}

release-please-config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"release-type": "android",
3+
"packages": {
4+
".": {
5+
"release-type": "simple",
6+
"extra-files": [
7+
"README.md",
8+
"build.gradle.kts"
9+
]
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)