Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions .github/workflows/flutter-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Flutter Mobile Build

on:
push:
branches:
- main
paths:
- 'mobile/lib/**'
- 'mobile/android/**'
- 'mobile/ios/**'
- 'mobile/pubspec.yaml'
- '.github/workflows/flutter-build.yml'
pull_request:
paths:
- 'mobile/lib/**'
- 'mobile/android/**'
- 'mobile/ios/**'
- 'mobile/pubspec.yaml'
- '.github/workflows/flutter-build.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
build-android:
name: Build Android APK
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.32.4'
channel: 'stable'
cache: true

- name: Get dependencies
working-directory: mobile
run: flutter pub get

- name: Generate app icons
working-directory: mobile
run: flutter pub run flutter_launcher_icons

- name: Analyze code
working-directory: mobile
run: flutter analyze --no-fatal-infos

- name: Run tests
working-directory: mobile
run: flutter test

- name: Decode and setup keystore
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
run: |
echo "$KEYSTORE_BASE64" | base64 -d > mobile/android/app/upload-keystore.jks
echo "storePassword=$KEY_STORE_PASSWORD" >> mobile/android/key.properties
echo "keyPassword=$KEY_PASSWORD" >> mobile/android/key.properties
echo "keyAlias=$KEY_ALIAS" >> mobile/android/key.properties
echo "storeFile=upload-keystore.jks" >> mobile/android/key.properties

- name: Build APK (Release)
working-directory: mobile
run: flutter build apk --release

- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: app-release-apk
path: mobile/build/app/outputs/flutter-apk/app-release.apk
retention-days: 30

- name: Build App Bundle (Release)
working-directory: mobile
run: flutter build appbundle --release

- name: Upload AAB artifact
uses: actions/upload-artifact@v4
with:
name: app-release-aab
path: mobile/build/app/outputs/bundle/release/app-release.aab
retention-days: 30

build-ios:
name: Build iOS IPA
runs-on: macos-latest
timeout-minutes: 45

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.32.4'
channel: 'stable'
cache: true

- name: Get dependencies
working-directory: mobile
run: flutter pub get

- name: Generate app icons
working-directory: mobile
run: flutter pub run flutter_launcher_icons

- name: Install CocoaPods dependencies
working-directory: mobile/ios
run: pod install

- name: Analyze code
working-directory: mobile
run: flutter analyze --no-fatal-infos

- name: Run tests
working-directory: mobile
run: flutter test

- name: Build iOS (No Code Signing)
working-directory: mobile
run: flutter build ios --release --no-codesign

- name: Create IPA archive info
working-directory: mobile
run: |
echo "iOS build completed successfully" > build/ios-build-info.txt
echo "Build date: $(date)" >> build/ios-build-info.txt
echo "Note: This build is not code-signed and cannot be installed on physical devices" >> build/ios-build-info.txt
echo "For distribution, you need to configure code signing with Apple certificates" >> build/ios-build-info.txt

- name: Upload iOS build artifact
uses: actions/upload-artifact@v4
with:
name: ios-build-unsigned
path: |
mobile/build/ios/iphoneos/Runner.app
mobile/build/ios-build-info.txt
retention-days: 30
50 changes: 50 additions & 0 deletions mobile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Flutter / Dart
.dart_tool/
.packages
.pub-cache/
.pub/
build/
.flutter-plugins
.flutter-plugins-dependencies
*.iml
.metadata
pubspec.lock

# Android
android/.gradle/
android/local.properties
android/app/build/
android/gradlew
android/gradlew.bat
android/key.properties
android/app/*.keystore
android/app/*.jks
keystore-base64.txt

# iOS
ios/Pods/
ios/.symlinks/
ios/Flutter/Flutter.framework
ios/Flutter/Flutter.podspec
ios/Flutter/Generated.xcconfig
ios/Runner.xcworkspace/
ios/Podfile.lock

# IDE
.idea/
*.iml
.vscode/

# macOS
.DS_Store
*/.DS_Store

# Environment
.env
.env.*

# Logs
*.log

# Miscellaneous
_codeql_detected_source_root
Loading