Build Android Release APK #19
Workflow file for this run
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: Build Android Release APK | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build: | |
name: Build APK | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'oracle' | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version: '3.19.x' | |
- name: Install Futter dependencies | |
run: flutter pub get | |
- name: Decode keystore file | |
env: | |
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | |
run: | | |
echo "$KEYSTORE_BASE64" | base64 --decode > android/key.jks | |
- name: Extract version information | |
run: | | |
echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_ENV | |
- name: Create key.properties | |
run: | | |
echo "storeFile=../key.jks" > android/key.properties | |
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" >> android/key.properties | |
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties | |
echo "keyPassword=${{ secrets.KEYSTORE_PASSWORD }}" >> android/key.properties | |
cat android/key.properties | |
- name: Build APK | |
run: | | |
cp .env.production .env | |
flutter build apk --release | |
- name: Make Github release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ env.VERSION }} | |
token: ${{ secrets.RELEASE_TOKEN }} | |
files: | | |
build/app/outputs/flutter-apk/app-release.apk |