diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9f3394c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,73 @@ +name: Release a new version + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v2 + + - name: set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Setup Gradle + uses: gradle/gradle-build-action@v3 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build changelog + id: build_changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configuration: "changelog_config.json" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Keystore + shell: bash + run: | + echo '${{ secrets.KEYSTORE_FILE }}' | base64 -d > ./app/podcaster_keystore.jks + echo "storeFile=./podcaster_keystore.jks" >> keystore.properties + echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> keystore.properties + echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> keystore.properties + echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> keystore.properties + env: + KEYSTORE_KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEYSTORE_KEY_PASSWORD: ${{ secrets.STORE_KEY_PASSWORD }} + KEYSTORE_STORE_PASSWORD: ${{ secrets.STORE_KEY_PASSWORD }} + + - name: Build & Publish Release (.aab) bundle to Play console + run: ./gradlew bundleRelease publishReleaseBundle + env: + ANDROID_PUBLISHER_CREDENTIALS: ${{ secrets.ANDROID_PUBLISHER_CREDENTIALS }} + + - name: Build release APK + run: ./gradlew assembleRelease --stacktrace + + - name: Upload release APK + uses: actions/upload-artifact@v4 + with: + name: app-release + path: ./app/build/outputs/apk/release/app-release.apk + + - uses: ncipollo/release-action@v1 + with: + artifacts: "./app/build/outputs/apk/release/app-release.apk" + body: ${{ steps.build_changelog.outputs.changelog }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index f462086..e5aa6cd 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ .cxx local.properties keystore.properties +play_config.json \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2a8f76f..640787e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -17,6 +17,7 @@ plugins { alias(libs.plugins.crashlytics) alias(libs.plugins.aboutlibraries) alias(libs.plugins.appversioning) + alias(libs.plugins.play.publisher) } android { @@ -133,6 +134,16 @@ appVersioning { } } +play { + // Enable automated publishing for CI only for now, as we don't need it locally. + if (System.getenv("CI").toBoolean()) { + defaultToAppBundles.set(true) + track.set("production") + } else { + enabled.set(false) + } +} + ksp { arg("lyricist.packageName", "com.mr3y.podcaster") } diff --git a/app/src/main/play/release-notes/en-US/production.txt b/app/src/main/play/release-notes/en-US/production.txt new file mode 100644 index 0000000..f095799 --- /dev/null +++ b/app/src/main/play/release-notes/en-US/production.txt @@ -0,0 +1,2 @@ +- 🆕 Add Support for Creating playlists. +- Fix Collapsed PlayerView UI being obscured by 3-buttons navigation bar. diff --git a/changelog_config.json b/changelog_config.json new file mode 100644 index 0000000..3146e31 --- /dev/null +++ b/changelog_config.json @@ -0,0 +1,38 @@ +{ + "categories": [ + { + "title": "## 🚀 Features", + "labels": ["feature", "enhancement"] + }, + { + "title": "## 🐛 Bugs", + "labels": ["bug"] + }, + { + "title": "## 🔧 Chore", + "labels": ["dependencies"] + } + ], + "ignore_labels": [ + "duplicate", "good first issue", "help wanted", "invalid", "question", "wontfix", "skip release notes", "hold" + ], + "sort": "ASC", + "template": "${{CHANGELOG}}", + "pr_template": "- ${{TITLE}} (#${{NUMBER}})", + "empty_template": "- no changes", + "transformers": [ + { + "pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)", + "target": "- $4\n - $6" + } + ], + "max_tags_to_fetch": 200, + "max_pull_requests": 200, + "max_back_track_time_days": 365, + "tag_resolver": { + "method": "semver" + }, + "base_branches": [ + "main" + ] +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fedcdaf..83b9337 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -40,6 +40,7 @@ leakcanary = "3.0-alpha-1" datastore = "1.1.0-beta01" aboutlibraries = "10.10.0" appversioning = "1.3.1" +gpp = "3.9.0" [libraries] 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 crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" } aboutlibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "aboutlibraries" } appversioning = { id = "io.github.reactivecircus.app-versioning", version.ref = "appversioning" } +play-publisher = { id = "com.github.triplet.play", version.ref = "gpp" } [bundles]