- Update build apk flavor to prod #12
This file contains hidden or 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: Flutter Build Apk | |
on: | |
push: | |
branches: | |
- main | |
- development | |
jobs: | |
build: | |
name: "Flutter Build APK" | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- run: java --version | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version: 3.29.2 | |
cache: true | |
- run: flutter --version | |
# Create .env.dev file | |
- name: Create .env.dev file | |
run: | | |
cat <<EOT >> apps/app_core/.env.dev | |
ENV=Development | |
BASE_API_URL=${{ secrets.BASE_API_URL_DEV }} | |
USER_API_URL=${{ secrets.USER_API_URL_DEV }} | |
IOS_APP_STORE_ID=${{ secrets.IOS_APP_STORE_ID }} | |
ONESIGNAL_APP_ID=${{ secrets.ONESIGNAL_APP_ID_DEV }} | |
EOT | |
# Create .env.staging file | |
- name: Create .env.staging file | |
run: | | |
cat <<EOT >> apps/app_core/.env.staging | |
ENV=Staging | |
BASE_API_URL=${{ secrets.BASE_API_URL_DEV }} | |
USER_API_URL=${{ secrets.USER_API_URL_DEV }} | |
IOS_APP_STORE_ID=${{ secrets.IOS_APP_STORE_ID }} | |
ONESIGNAL_APP_ID=${{ secrets.ONESIGNAL_APP_ID_DEV }} | |
EOT | |
# Create .env.prod file | |
- name: Create .env.prod file | |
run: | | |
cat <<EOT >> apps/app_core/.env.prod | |
ENV=Production | |
BASE_API_URL=${{ secrets.BASE_API_URL_PROD }} | |
USER_API_URL=${{ secrets.USER_API_URL_PROD }} | |
IOS_APP_STORE_ID=${{ secrets.IOS_APP_STORE_ID }} | |
ONESIGNAL_APP_ID=${{ secrets.ONESIGNAL_APP_ID_PROD }} | |
EOT | |
- name: Install melos | |
run: flutter pub global activate melos | |
- name: Setup melos | |
run: melos bs | |
- name: Generate Assets, Enviroments Configurations and Hive Code | |
run: melos run build-runner | |
- name: Run Localisation Key Generation | |
run: melos run locale-gen | |
- name: Run Asset generation | |
run: melos run asset-gen | |
# Build Android apk for prod flavor | |
- name: Build Android apk For Production | |
run: melos run build-apk | |
- name: Upload the build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-release | |
path: apps/app_core/build/app/outputs/flutter-apk/app-prod-release.apk | |