Skip to content

Commit

Permalink
create release_app.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cem256 committed Jun 23, 2024
1 parent e9ebf28 commit dc61de0
Showing 1 changed file with 99 additions and 0 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/release_app.yml
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 }}

0 comments on commit dc61de0

Please sign in to comment.