Android Release #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version number (e.g., 1.0.0)' | |
required: true | |
type: string | |
branch: | |
description: 'Branch to create release from' | |
required: true | |
default: 'main' | |
type: string | |
notes: | |
description: 'Release notes' | |
required: false | |
type: string | |
default: 'No release notes provided' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
- name: Create and push tag | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git tag -a v${{ github.event.inputs.version }} -m "Release v${{ github.event.inputs.version }}" | |
git push origin v${{ github.event.inputs.version }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Create release keystore | |
env: | |
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }} | |
run: | | |
echo "$RELEASE_KEYSTORE" | base64 -d > android/app/release.keystore | |
- name: Create .env file | |
env: | |
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }} | |
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
run: | | |
echo "ANDROID_STORE_PASSWORD=$ANDROID_STORE_PASSWORD" > .env | |
echo "ANDROID_KEY_ALIAS=$ANDROID_KEY_ALIAS" >> .env | |
echo "ANDROID_KEY_PASSWORD=$ANDROID_KEY_PASSWORD" >> .env | |
- name: Build Release APK and Bundle | |
run: npm run android:build-release | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release v${{ github.event.inputs.version }} | |
tag_name: v${{ github.event.inputs.version }} | |
body: | | |
Release v${{ github.event.inputs.version }} | |
${{ github.event.inputs.notes }} | |
### Installation | |
- Download and install the APK on your Android device | |
- Alternatively, wait for the Play Store release | |
### Note | |
The AAB file is for Play Store submission only. For direct installation, use the APK. | |
files: | | |
android/app/build/outputs/apk/release/app-release.apk | |
android/app/build/outputs/bundle/release/app-release.aab |