-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
99 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Build and release Flutter App | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag_name: | ||
description: 'Tag name for the release' | ||
required: true | ||
|
||
jobs: | ||
build-app: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout 📥 | ||
uses: actions/[email protected] | ||
|
||
- name: Get google-services.json 🗝 | ||
id: google_services | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: google-services.json | ||
fileDir: './android/app/' | ||
encodedString: ${{ secrets.GOOGLE_SERVICES }} | ||
|
||
- name: Get firebase_options.dart 🗂️ | ||
id: firebase_options | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: firebase_options.dart | ||
fileDir: './lib/' | ||
encodedString: ${{ secrets.FIREBASE_OPTIONS }} | ||
|
||
- name: Get env file 🗝 | ||
id: env_file | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: .env | ||
fileDir: './env/' | ||
encodedString: ${{ secrets.ENV_FILE }} | ||
|
||
- name: Get keystore file 🗝 | ||
id: android_keystore | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: upload-keystore.jks | ||
fileDir: './android/app/' | ||
encodedString: ${{ secrets.KEYSTORE }} | ||
|
||
- name: Get key properties file 🗝 | ||
id: key_properties | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: key.properties | ||
fileDir: './android/' | ||
encodedString: ${{ secrets.KEY_PROPERTIES }} | ||
|
||
- name: Setup Java ☕ | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'adopt' | ||
java-version: "17.x" | ||
cache: 'gradle' | ||
|
||
- name: Setup Flutter 📱 | ||
uses: subosito/[email protected] | ||
with: | ||
channel: 'stable' | ||
flutter-version: '${{ vars.FLUTTER_VERSION }}' | ||
|
||
- name: Install dependencies 📦 | ||
run: flutter pub get | ||
|
||
- name: Run build_runner 🏗️ | ||
run: dart run build_runner build --delete-conflicting-outputs | ||
|
||
- name: Build Android App (fat APK) 📦 | ||
run: flutter build apk | ||
|
||
- name: Build Android App (Multiple APKs) 📦📦 | ||
run: flutter build apk --split-per-abi | ||
|
||
- name: Rename files ✏️ | ||
run: | | ||
cd build/app/outputs/flutter-apk && | ||
mv app-release.apk gpt_detector-universal.apk && | ||
mv app-arm64-v8a-release.apk gpt_detector-arm64.apk && | ||
mv app-armeabi-v7a-release.apk gpt_detector-armeabi.apk && | ||
mv app-x86_64-release.apk gpt_detector-x86.apk | ||
- name: Upload APKs 🚀 | ||
uses: softprops/[email protected] | ||
with: | ||
files: 'build/app/outputs/flutter-apk/*.apk' | ||
tag_name: ${{ github.event.inputs.tag_name }} | ||
token: ${{ secrets.GH_TOKEN }} |