Skip to content

Commit cde11c8

Browse files
runningcodeinktomiclaude
authored
Automate release publishing via GitHub Actions (#493)
* Automate release publishing via GitHub Actions Add a release workflow triggered on tag push that publishes to Maven Central, Gradle Plugin Portal, and creates a GitHub Release. Simplify CI snapshot publishing to use a single vanniktech publishToMavenCentral task and pass secrets via env vars instead of -P flags. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Matthew Runo <74583+inktomi@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1a09e25 commit cde11c8

File tree

6 files changed

+61
-18
lines changed

6 files changed

+61
-18
lines changed

.github/workflows/gradle-build.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ jobs:
1616
name: Setup Gradle
1717
- name: Check Fladle
1818
run: ./gradlew assembleDebug assembleDebugAndroidTest printYml check :fladle-plugin:check
19-
- name: Publish Marker Snapshot
19+
- name: Publish Snapshot
2020
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
21-
run: ./gradlew :fladle-plugin:publishFladlePluginMarkerMavenPublicationToMavenCentralRepository :fladle-plugin:publishFulladlePluginMarkerMavenPublicationToMavenCentralRepository -Pfladle.releaseMode -PmavenCentralUsername=${{ secrets.SONATYPE_USERNAME }} -PmavenCentralPassword=${{ secrets.SONATYPE_PASSWORD }}
22-
- name: Publish Plugin Snapshot
23-
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
24-
run: ./gradlew :fladle-plugin:publishPluginMavenPublicationToMavenCentralRepository -Pfladle.releaseMode -PmavenCentralUsername=${{ secrets.SONATYPE_USERNAME }} -PmavenCentralPassword=${{ secrets.SONATYPE_PASSWORD }}
21+
env:
22+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
23+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
24+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }}
25+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_SIGNING_KEY_ID }}
26+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
27+
run: ./gradlew :fladle-plugin:publishToMavenCentral --no-configuration-cache
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Release"
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
workflow_dispatch:
7+
8+
jobs:
9+
release:
10+
name: "Publish Release"
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v6
16+
- uses: actions/setup-java@v5
17+
with:
18+
java-version: "17"
19+
distribution: "temurin"
20+
- uses: gradle/actions/setup-gradle@v5
21+
- name: Publish to Maven Central
22+
env:
23+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
24+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
25+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }}
26+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_SIGNING_KEY_ID }}
27+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
28+
run: ./gradlew :fladle-plugin:publishToMavenCentral --no-configuration-cache
29+
- name: Publish to Gradle Plugin Portal
30+
env:
31+
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
32+
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
33+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }}
34+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_SIGNING_KEY_ID }}
35+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
36+
run: ./gradlew :fladle-plugin:publishPlugins
37+
- name: Create GitHub Release
38+
env:
39+
GH_TOKEN: ${{ github.token }}
40+
run: gh release create "${{ github.ref_name }}" --generate-notes

docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
* Minimum required Gradle version is now 9.1
55
* Fixed support for Android Gradle Plugin version 9.0.1
66

7+
## 0.20.0
8+
* Minimum required Gradle version is now 9.1
9+
* Fixed support for Android Gradle Plugin version 9.0.1
10+
711
## 0.19.0
812
* Minimum required JVM version is now 17.
913
* Minimum supported Gradle version is now 7.3.

docs/releasing.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,14 @@ git tag v{{ fladle.next_release }}
3636
git push origin v{{ fladle.next_release }}
3737
```
3838

39-
* Upload to Maven Central (this must run in two separate commands since they are from two different namespaces)
40-
``` bash
41-
./gradlew :fladle-plugin:publishFladlePluginMarkerMavenPublicationToMavenCentralRepository :fladle-plugin:publishFulladlePluginMarkerMavenPublicationToMavenCentralRepository -Pfladle.release
42-
./gradlew :fladle-plugin:publishPluginMavenPublicationToMavenCentralRepository -Pfladle.release
43-
```
44-
* Upload to Gradle Plugin Portal
45-
```bash
46-
./gradlew :fladle-plugin:publishPlugins -Pfladle.releaseMode -Dorg.gradle.internal.publish.checksums.insecure=true
47-
```
39+
Pushing the tag automatically triggers the [release workflow](https://github.com/runningcode/fladle/actions/workflows/gradle-release.yml) which:
40+
41+
1. Publishes to Maven Central
42+
2. Publishes to Gradle Plugin Portal
43+
3. Creates a GitHub Release with auto-generated notes
4844

4945
* Release to Maven Central
50-
* Login to Maven Central Repository: [https://central.sonatype.com/](https://oss.sonatype.com/)
46+
* Login to Maven Central Repository: [https://central.sonatype.com/](https://central.sonatype.com/)
5147
* Click on **Publish**
5248

5349
* Merge the release branch to master

fladle-plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.gradle.api.tasks.testing.logging.TestLogEvent
22

33
group = "com.osacky.flank.gradle"
4-
version = "0.19.1-SNAPSHOT"
4+
version = "0.20.0"
55
description = "Easily Scale your Android Instrumentation Tests with Firebase Test Lab with Flank"
66

77
repositories {

mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
extra:
66
fladle:
7-
current_release: '0.19.0'
8-
next_release: '0.19.1'
7+
current_release: '0.20.0'
8+
next_release: '0.20.1'
99
flank_version: '23.10.1'
1010

1111
site_name: Fladle

0 commit comments

Comments
 (0)