Skip to content

Commit 51e3038

Browse files
authored
chore: migrate to release please (#812)
* chore: migrate from semantic-release to release-please * chore: add region tags * chore: add region tags * chore: add region tags * chore: add publish flow
1 parent 03b934d commit 51e3038

File tree

8 files changed

+53
-76
lines changed

8 files changed

+53
-76
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,27 @@
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
163
on:
17-
push:
18-
branches: [ main ]
19-
workflow_dispatch:
4+
release:
5+
types: [published]
206

217
jobs:
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-
uses: cycjimmy/[email protected]
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
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
name: release-please
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
config-file: release-please-config.json
20+
manifest-file: .release-please-manifest.json

.release-please-manifest.json

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

.releaserc

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

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ You no longer need to specify the Maps SDK for Android or its Utility Library as
2929

3030
```groovy
3131
dependencies {
32-
implementation 'com.google.maps.android:maps-compose:6.12.2'
33-
32+
implementation 'com.google.maps.android:maps-compose:6.12.2' // {x-release-please-version}
3433
// Optionally, you can include the Compose utils library for Clustering,
3534
// Street View metadata checks, etc.
36-
implementation 'com.google.maps.android:maps-compose-utils:6.12.2'
37-
35+
implementation 'com.google.maps.android:maps-compose-utils:6.12.2' // {x-release-please-version}
3836
// Optionally, you can include the widgets library for ScaleBar, etc.
39-
implementation 'com.google.maps.android:maps-compose-widgets:6.12.2'
37+
implementation 'com.google.maps.android:maps-compose-widgets:6.12.2' // {x-release-please-version}
4038
}
4139
```
4240

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ val projectArtifactId by extra { project: Project ->
3232

3333
allprojects {
3434
group = "com.google.maps.android"
35+
// {x-release-please-start-version}
3536
version = "6.12.2"
37+
// {x-release-please-end}
3638
}

gradle.properties

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,3 @@ android.nonTransitiveRClass=false
3434
android.nonFinalResIds=false
3535

3636
android.experimental.enableScreenshotTest=true
37-
38-
# Add a property to enable automatic release to Maven Central (optional, but good for CI)
39-
# If true, publishToMavenCentral will also close and release the staging repository
40-
mavenCentralAutomaticRelease=false

release-please-config.json

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

0 commit comments

Comments
 (0)