Skip to content

Commit a92185b

Browse files
authored
chore: migrate from semantic-release to release-please (#66)
1 parent 33f87af commit a92185b

8 files changed

Lines changed: 87 additions & 100 deletions

File tree

.github/workflows/publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
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
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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: google-github-actions/release-please-action@v4
17+
id: release
18+
with:
19+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
20+
config-file: release-please-config.json
21+
manifest-file: .release-please-manifest.json

.github/workflows/release.yml

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

.releaserc

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

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@ Add the dependency below to your **module-level** Gradle build file:
2727

2828
```kotlin
2929
dependencies {
30-
implementation("com.google.maps.android:places-compose:0.2.0")
30+
implementation("com.google.maps.android:places-compose:0.2.0") // {x-release-please-version}
3131
}
32+
3233
```
3334

3435
### Groovy (`build.gradle`)
3536

3637
```groovy
3738
dependencies {
38-
implementation 'com.google.maps.android:places-compose:0.2.0'
39+
implementation 'com.google.maps.android:places-compose:0.2.0' // {x-release-please-version}
3940
}
41+
4042
```
4143

4244
## Sample App

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ plugins {
1717

1818
allprojects {
1919
group = "com.google.maps.android"
20+
// {x-release-please-start-version}
2021
version = "0.2.0"
22+
// {x-release-please-end}
2123
val projectArtifactId by extra { project.name }
2224
}

release-please-config.json

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

0 commit comments

Comments
 (0)