Skip to content

Commit dd244d9

Browse files
committed
chore: migrate from semantic-release to release-please
1 parent 5677565 commit dd244d9

File tree

7 files changed

+73
-85
lines changed

7 files changed

+73
-85
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: google-github-actions/release-please-action@v4
17+
id: release
18+
with:
19+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
20+
21+
- uses: actions/checkout@v4
22+
if: ${{ steps.release.outputs.release_created }}
23+
with:
24+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
25+
26+
- uses: gradle/actions/wrapper-validation@v3
27+
if: ${{ steps.release.outputs.release_created }}
28+
29+
- name: Create .gpg key
30+
if: ${{ steps.release.outputs.release_created }}
31+
run: |
32+
echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc
33+
gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc
34+
35+
echo "Build and publish"
36+
sed -i -e "s,mavenCentralUsername=,mavenCentralUsername=$SONATYPE_USERNAME,g" gradle.properties
37+
SONATYPE_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_PASSWORD" | sed -e 's/[\/&]/\\&/g')
38+
sed -i -e "s,mavenCentralPassword=,mavenCentralPassword=$SONATYPE_PASSWORD_ESCAPED,g" gradle.properties
39+
sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties
40+
sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties
41+
sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties
42+
env:
43+
GPG_KEY_ARMOR: "${{ secrets.SYNCED_GPG_KEY_ARMOR }}"
44+
GPG_KEY_ID: ${{ secrets.SYNCED_GPG_KEY_ID }}
45+
GPG_PASSWORD: ${{ secrets.SYNCED_GPG_KEY_PASSWORD }}
46+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }}
47+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_TOKEN }}
48+
49+
- name: Publish to Maven Central
50+
if: ${{ steps.release.outputs.release_created }}
51+
run: ./gradlew publishToMavenCentral
52+
env:
53+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_TOKEN }}
54+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_TOKEN_PASSWORD }}

.github/workflows/release.yml

Lines changed: 0 additions & 59 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+
".": "1.0.0"
3+
}

.releaserc

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

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ plugins {
4242
// Shared configs
4343
allprojects {
4444
group = "com.google.maps.android"
45-
version = "1.0.0"
45+
4646

4747
repositories {
4848
google()

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ android.useAndroidX=true
1919
android.enableJetifier=false
2020
# Kotlin code style for this project: "official" or "obsolete":
2121
kotlin.code.style=official
22+
version=1.0.0
23+
2224

2325
# variables required to allow build.gradle to parse,
2426
# override in ~/.gradle/gradle.properties

release-please-config.json

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

0 commit comments

Comments
 (0)