Skip to content

Workflow file for this run

name: Build split apks and attach to release
on:
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.16.0"
- name: Install dependencies
run: |
flutter config --no-analytics
flutter pub get
- name: Configure Keystore for Android
run: |
echo "$PLAY_STORE_UPLOAD_KEY" | base64 --decode > app/upload-keystore.jks
echo "storeFile=upload-keystore.jks" >> key.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> key.properties
env:
PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
working-directory: android
- name: Build full APK
run: flutter build apk --release
- name: Build APKs split per abi
run: flutter build apk --release --split-per-abi
- name: Rename output files
run: |
mv "build/app/outputs/flutter-apk/app-release.apk" "build/app/outputs/flutter-apk/openreads-${{ github.event.release.tag_name }}-release.apk"
mv "build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk" "build/app/outputs/flutter-apk/openreads-${{ github.event.release.tag_name }}-armeabi-v7a-release.apk"
mv "build/app/outputs/flutter-apk/app-arm64-v8a-release.apk" "build/app/outputs/flutter-apk/openreads-${{ github.event.release.tag_name }}-arm64-v8a-release.apk"
mv "build/app/outputs/flutter-apk/app-x86_64-release.apk" "build/app/outputs/flutter-apk/openreads-${{ github.event.release.tag_name }}-x86_64-release.apk"
- name: Attach apk files
uses: softprops/action-gh-release@v1
with:
files: |
build/app/outputs/flutter-apk/openreads-${{ github.event.release.tag_name }}-release.apk
build/app/outputs/flutter-apk/openreads-${{ github.event.release.tag_name }}-armeabi-v7a-release.apk
build/app/outputs/flutter-apk/openreads-${{ github.event.release.tag_name }}-arm64-v8a-release.apk
build/app/outputs/flutter-apk/openreads-${{ github.event.release.tag_name }}-x86_64-release.apk