Skip to content

chore: update GitHub Actions workflow for Flutter builds #132

chore: update GitHub Actions workflow for Flutter builds

chore: update GitHub Actions workflow for Flutter builds #132

Workflow file for this run

name: Create Build Artifacts
on:
push:
jobs:
buildStarter:
name: Build Starter App
runs-on: ubuntu-latest
strategy:
matrix:
flutter-version: ["3.24.0", "3.27.2"]
platform: ["web", "android"]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
channel: 'stable'
- name: Install Melos
run: dart pub global activate melos
- name: Debug Flutter Version
run: |
flutter --version
dart --version
- name: Bootstrap Melos
run: |
melos bootstrap
echo "Melos bootstrap completed successfully"
- name: Verify Dependencies
run: |
cd starter
flutter pub deps --style=tree | head -20
echo "Dependency verification completed"
- name: Create temporary keystore for Android signing
if: matrix.platform == 'android'
run: |
cd starter/android
# Create a temporary keystore for CI builds
keytool -genkey -v -keystore ci-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias ci-key \
-dname "CN=CI Build, OU=CI, O=Ensemble, L=City, S=State, C=US" \
-storepass ci-password -keypass ci-password
# Create key.properties file with absolute path
cat > key.properties << EOF
storePassword=ci-password
keyPassword=ci-password
keyAlias=ci-key
storeFile=$(pwd)/ci-release-key.jks
EOF
# Verify files were created
ls -la ci-release-key.jks key.properties
- name: Clean and Build for ${{ matrix.platform }}
run: |
cd starter
echo "Building for platform: ${{ matrix.platform }}"
echo "Flutter version:"
flutter --version
echo "Cleaning previous builds..."
flutter clean
flutter pub get
echo "Starting build..."
case "${{ matrix.platform }}" in
web)
flutter build web --release --no-tree-shake-icons --verbose
;;
android)
flutter build apk --release --no-tree-shake-icons --verbose
;;
esac
echo "Build completed successfully"
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: starter-build-${{ matrix.platform }}-flutter-${{ matrix.flutter-version }}
path: |
starter/build/web/**
starter/build/app/outputs/flutter-apk/*-release.apk
retention-days: 7