Skip to content

Commit 2aabc6c

Browse files
Automate Publishing new updates process (#15)
1 parent 8a71fd8 commit 2aabc6c

File tree

6 files changed

+127
-0
lines changed

6 files changed

+127
-0
lines changed

.github/workflows/release.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Release a new version
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Validate Gradle Wrapper
20+
uses: gradle/wrapper-validation-action@v2
21+
22+
- name: set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '17'
26+
distribution: 'temurin'
27+
cache: gradle
28+
29+
- name: Setup Gradle
30+
uses: gradle/gradle-build-action@v3
31+
32+
- name: Grant execute permission for gradlew
33+
run: chmod +x gradlew
34+
35+
- name: Build changelog
36+
id: build_changelog
37+
uses: mikepenz/release-changelog-builder-action@v4
38+
with:
39+
configuration: "changelog_config.json"
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Configure Keystore
44+
shell: bash
45+
run: |
46+
echo '${{ secrets.KEYSTORE_FILE }}' | base64 -d > ./app/podcaster_keystore.jks
47+
echo "storeFile=./podcaster_keystore.jks" >> keystore.properties
48+
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> keystore.properties
49+
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> keystore.properties
50+
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> keystore.properties
51+
env:
52+
KEYSTORE_KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
53+
KEYSTORE_KEY_PASSWORD: ${{ secrets.STORE_KEY_PASSWORD }}
54+
KEYSTORE_STORE_PASSWORD: ${{ secrets.STORE_KEY_PASSWORD }}
55+
56+
- name: Build & Publish Release (.aab) bundle to Play console
57+
run: ./gradlew bundleRelease publishReleaseBundle
58+
env:
59+
ANDROID_PUBLISHER_CREDENTIALS: ${{ secrets.ANDROID_PUBLISHER_CREDENTIALS }}
60+
61+
- name: Build release APK
62+
run: ./gradlew assembleRelease --stacktrace
63+
64+
- name: Upload release APK
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: app-release
68+
path: ./app/build/outputs/apk/release/app-release.apk
69+
70+
- uses: ncipollo/release-action@v1
71+
with:
72+
artifacts: "./app/build/outputs/apk/release/app-release.apk"
73+
body: ${{ steps.build_changelog.outputs.changelog }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
.cxx
1717
local.properties
1818
keystore.properties
19+
play_config.json

app/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ plugins {
1717
alias(libs.plugins.crashlytics)
1818
alias(libs.plugins.aboutlibraries)
1919
alias(libs.plugins.appversioning)
20+
alias(libs.plugins.play.publisher)
2021
}
2122

2223
android {
@@ -133,6 +134,16 @@ appVersioning {
133134
}
134135
}
135136

137+
play {
138+
// Enable automated publishing for CI only for now, as we don't need it locally.
139+
if (System.getenv("CI").toBoolean()) {
140+
defaultToAppBundles.set(true)
141+
track.set("production")
142+
} else {
143+
enabled.set(false)
144+
}
145+
}
146+
136147
ksp {
137148
arg("lyricist.packageName", "com.mr3y.podcaster")
138149
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- 🆕 Add Support for Creating playlists.
2+
- Fix Collapsed PlayerView UI being obscured by 3-buttons navigation bar.

changelog_config.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"categories": [
3+
{
4+
"title": "## 🚀 Features",
5+
"labels": ["feature", "enhancement"]
6+
},
7+
{
8+
"title": "## 🐛 Bugs",
9+
"labels": ["bug"]
10+
},
11+
{
12+
"title": "## 🔧 Chore",
13+
"labels": ["dependencies"]
14+
}
15+
],
16+
"ignore_labels": [
17+
"duplicate", "good first issue", "help wanted", "invalid", "question", "wontfix", "skip release notes", "hold"
18+
],
19+
"sort": "ASC",
20+
"template": "${{CHANGELOG}}",
21+
"pr_template": "- ${{TITLE}} (#${{NUMBER}})",
22+
"empty_template": "- no changes",
23+
"transformers": [
24+
{
25+
"pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)",
26+
"target": "- $4\n - $6"
27+
}
28+
],
29+
"max_tags_to_fetch": 200,
30+
"max_pull_requests": 200,
31+
"max_back_track_time_days": 365,
32+
"tag_resolver": {
33+
"method": "semver"
34+
},
35+
"base_branches": [
36+
"main"
37+
]
38+
}

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ leakcanary = "3.0-alpha-1"
4040
datastore = "1.1.0-beta01"
4141
aboutlibraries = "10.10.0"
4242
appversioning = "1.3.1"
43+
gpp = "3.9.0"
4344

4445
[libraries]
4546
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }
@@ -116,6 +117,7 @@ google-services = { id = "com.google.gms.google-services", version.ref = "google
116117
crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" }
117118
aboutlibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "aboutlibraries" }
118119
appversioning = { id = "io.github.reactivecircus.app-versioning", version.ref = "appversioning" }
120+
play-publisher = { id = "com.github.triplet.play", version.ref = "gpp" }
119121

120122
[bundles]
121123

0 commit comments

Comments
 (0)