Build AnimeGo APK for release #14
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 AnimeGo APK for release | |
on: workflow_dispatch | |
# Manual input if needed | |
# inputs: | |
# version: | |
# description: 'Application version' | |
# required: true | |
# default: '1.0' | |
# build apk using Flutter | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Decode Keystore | |
id: decode_keystore | |
uses: timheuer/[email protected] | |
with: | |
fileName: 'android_keystore.jks' | |
fileDir: project/android/app/keystore/ | |
encodedString: ${{ secrets.KEYSTORE }} | |
- name: Validate Keystore | |
run: | | |
if test -f project/android/app/keystore/android_keystore.jks; then | |
echo "Keystore file exists." | |
else | |
echo "Keystore file does not exist." | |
exit 1 | |
fi | |
- name: Provide key.properties | |
run: | | |
cd project | |
cd android | |
echo '${{ secrets.KEY_PROPERTIES }}' > key.properties | |
- name: Validate keystore & key.properties | |
run: | | |
cd project/android | |
if test -f key.properties && test -f app/keystore/android_keystore.jks; then | |
echo "Keystore and key.properties are valid." | |
else | |
exit 1 | |
fi | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.22.0' | |
channel: 'stable' | |
- name: Get dependencies | |
run: cd project && flutter pub get | |
- name: Build APK | |
run: cd project && flutter build apk | |
- name: Move APK to root folder | |
run: mv project/build/app/outputs/flutter-apk/app-release.apk app-release.apk | |
- name: Make a draft release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: app-release.apk |