mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 18:47:03 +05:30
feat(github): make release workflow self-contained
This commit is contained in:
parent
8af4bddfe1
commit
2d44ad2055
1 changed files with 45 additions and 11 deletions
56
.github/workflows/release.yml
vendored
56
.github/workflows/release.yml
vendored
|
@ -1,8 +1,6 @@
|
||||||
name: Release to Google Play
|
name: Release to Google Play
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
tags:
|
|
||||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-google-play-release:
|
publish-google-play-release:
|
||||||
|
@ -10,6 +8,8 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
|
||||||
|
with:
|
||||||
|
depth: 0
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # tag=v3.6.0
|
uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # tag=v3.6.0
|
||||||
|
@ -17,17 +17,35 @@ jobs:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 18
|
java-version: 18
|
||||||
|
|
||||||
|
- name: Set up Git author
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git config user.name "GitHub Actions"
|
||||||
|
git config user.email noreply@github.com
|
||||||
|
|
||||||
|
- name: Setup Gradle caching
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef # tag=v2.3.3
|
||||||
|
with:
|
||||||
|
gradle-home-cache-cleanup: true
|
||||||
|
cache-read-only: true
|
||||||
|
|
||||||
- name: Decrypt secrets
|
- name: Decrypt secrets
|
||||||
run: scripts/signing-setup.sh "$ENCRYPT_KEY"
|
run: scripts/signing-setup.sh "$ENCRYPT_KEY"
|
||||||
env:
|
env:
|
||||||
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}
|
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}
|
||||||
|
|
||||||
- name: Build release bundle
|
- name: Prepare release assets
|
||||||
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef # tag=v2.3.3
|
shell: bash
|
||||||
with:
|
run: |
|
||||||
arguments: collectReleaseBundle
|
# Remove the `-SNAPSHOT` suffix
|
||||||
gradle-home-cache-cleanup: true
|
./gradlew -q clearPreRelease
|
||||||
cache-read-only: true
|
git commit -am 'feat(release): bump version'
|
||||||
|
|
||||||
|
# Build the release assets
|
||||||
|
./gradlew collectReleaseApks collectReleaseBundle
|
||||||
|
|
||||||
|
- name: Clean secrets
|
||||||
|
run: scripts/signing-cleanup.sh
|
||||||
|
|
||||||
- name: Publish bundle to Google Play
|
- name: Publish bundle to Google Play
|
||||||
uses: r0adkll/upload-google-play@78c9e796b1035c94169c101d8e46cb880194bfc3 # tag=v1.0.19
|
uses: r0adkll/upload-google-play@78c9e796b1035c94169c101d8e46cb880194bfc3 # tag=v1.0.19
|
||||||
|
@ -40,5 +58,21 @@ jobs:
|
||||||
track: production
|
track: production
|
||||||
whatsNewDirectory: distribution/whatsnew
|
whatsNewDirectory: distribution/whatsnew
|
||||||
|
|
||||||
- name: Clean secrets
|
- name: Post-release work
|
||||||
run: scripts/signing-cleanup.sh
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# Tag the current version
|
||||||
|
VERSION="$(tail -n1 android/version.properties | cut -d = -f 2)"
|
||||||
|
git tag "v${VERSION}" -F distribution/whatsnew/whatsnew-en-GB
|
||||||
|
|
||||||
|
# Push everything to GitHub
|
||||||
|
git push origin --all
|
||||||
|
|
||||||
|
# Create a GitHub release
|
||||||
|
gh release create "v${VERSION}" -F distribution/whatsnew/whatsnew-en-GB --title "v${VERSION}" ./android/apk/*.apk ./android/bundle/*.aab
|
||||||
|
|
||||||
|
# Start the next development iteration
|
||||||
|
./gradlew -q bumpSnapshot
|
||||||
|
truncate -s 0 distribution/whatsnew/whatsnew-en-GB # Clear changelog
|
||||||
|
git commit -am 'feat(release): start next development iteration'
|
||||||
|
git push origin main
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue