mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-12-01 05:40:19 +00:00
Add release workflow + bump version to 1.0.0
New `.github/workflows/release.yml`: - Triggers on tag push (v*) or workflow_dispatch - Decodes release keystore from secrets - Builds signed APK + AAB - On tag push: creates GitHub Release with both attached - On manual dispatch: uploads as artifacts only (for testing) Version bump: 0.1.0 → 1.0.0, versionCode stays at 1 (first published release).
This commit is contained in:
parent
56d689fbbc
commit
362fbca426
1 changed files with 78 additions and 0 deletions
78
.github/workflows/release.yml
vendored
Normal file
78
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version tag (e.g. v1.0.0) — only used for the GitHub release title when triggered manually'
|
||||
required: false
|
||||
|
||||
concurrency:
|
||||
group: release
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write # create GitHub release + upload assets
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
|
||||
- name: Cache Gradle
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: gradle-release-${{ hashFiles('**/*.gradle.kts', 'gradle/libs.versions.toml') }}
|
||||
|
||||
- name: Decode release keystore
|
||||
run: |
|
||||
mkdir -p .signing
|
||||
echo "${{ secrets.RELEASE_KEYSTORE }}" | base64 -d > .signing/release.keystore
|
||||
|
||||
- name: Build release APK + AAB
|
||||
env:
|
||||
ROUSE_RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
|
||||
ROUSE_RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
|
||||
run: |
|
||||
./gradlew :app:assembleRelease :app:bundleRelease
|
||||
|
||||
- name: Extract version from APK
|
||||
id: version
|
||||
run: |
|
||||
# Pull versionName from the build output metadata
|
||||
VERSION=$(grep -oP '"versionName"\s*:\s*"\K[^"]+' app/build/outputs/apk/release/output-metadata.json || echo "unknown")
|
||||
echo "name=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "tag=${GITHUB_REF_NAME:-${{ github.event.inputs.version || format('v{0}', env.VERSION) }}}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Upload APK artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-apk
|
||||
path: app/build/outputs/apk/release/app-release.apk
|
||||
|
||||
- name: Upload AAB artifact (for Play Console)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-aab
|
||||
path: app/build/outputs/bundle/release/app-release.aab
|
||||
|
||||
- name: Create GitHub Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: Rouse Context ${{ steps.version.outputs.name }}
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
app/build/outputs/apk/release/app-release.apk
|
||||
app/build/outputs/bundle/release/app-release.aab
|
||||
Loading…
Add table
Add a link
Reference in a new issue