-
Notifications
You must be signed in to change notification settings - Fork 16
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
1 parent
3930c9e
commit 21bd69f
Showing
3 changed files
with
111 additions
and
31 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build Flutter APK | ||
name: Build APK Workflow | ||
|
||
on: | ||
push: | ||
|
@@ -9,30 +9,96 @@ on: | |
- hcmpre-717-github-actions-build-apk # Optionally, run on pull requests targeting the 'main' branch | ||
|
||
jobs: | ||
build: | ||
build-apk: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the latest code from the repository | ||
- name: Checkout repository | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Install Flutter dependencies using the official Flutter GitHub action | ||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
flutter-version: '3.16.5' | ||
java-version: '11' | ||
distribution: 'temurin' # Specify the Java distribution | ||
|
||
# Run flutter pub get to fetch dependencies | ||
- name: Install dependencies | ||
run: flutter pub get | ||
- name: Flutter action | ||
uses: subosito/[email protected] | ||
with: | ||
flutter-version: "3.16.5" | ||
|
||
- name: Build debug APK | ||
run: ./tools/generate-apk.sh | ||
# Run flutter build apk to build the APK | ||
# Archive the APK as a build artifact so it can be downloaded | ||
- name: Upload APK | ||
uses: actions/upload-artifact@v3 | ||
- name: Set up Android SDK | ||
uses: android-actions/setup-android@v2 | ||
with: | ||
name: app-release-apk | ||
path: ./apps/health_campaign_field_worker_app/build/app/outputs/flutter-apk/app-release.apk | ||
api-level: 30 | ||
build-tools: 30.0.3 | ||
|
||
- name: Install Dependencies | ||
run: flutter pub get | ||
|
||
- name: Run APK build script | ||
env: | ||
ENVIRONMENT: QA # or UAT/DEV/ALL depending on your choice | ||
BUILD_CONFIG: release # or profile depending on your choice | ||
run: yes 1 | bash ./tools/generate-apk.sh | ||
|
||
|
||
#name: Build Flutter APK | ||
# | ||
#on: | ||
# push: | ||
# branches: | ||
# - hcmpre-717-github-actions-build-apk # This specifies that the workflow will run on any push to the 'main' branch | ||
# pull_request: | ||
# branches: | ||
# - hcmpre-717-github-actions-build-apk # Optionally, run on pull requests targeting the 'main' branch | ||
# | ||
#jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
# | ||
# steps: | ||
# # Checkout the latest code from the repository | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v3 | ||
# | ||
# - name: Set up JDK 11 | ||
# uses: actions/setup-java@v1 | ||
# with: | ||
# java-version: '11' | ||
# | ||
# - name: Display working directory | ||
# run: pwd | ||
# | ||
# - name: List files | ||
# run: ls -R | ||
# | ||
# - name: Build release APK | ||
# working-directory: ./apps/health_campaign_field_worker_app/android | ||
# run: bash ./gradlew assembleRelease --stacktrace | ||
# | ||
# - name: Build release APK | ||
# run: bash ./health_campaign_field_worker_app/android/gradlew assembleRelease --stacktrace | ||
# | ||
# - name: Rename APK | ||
# run: | ||
# mv "./app/build/outputs/apk/release/app-release.apk" "./app/build/outputs/apk/release/${{ env.OUTPUT_NAME }}.apk" | ||
# | ||
# - name: Upload release APK | ||
# uses: actions/upload-artifact@v1 | ||
# with: | ||
# name: ${{ env.OUTPUT_NAME }} | ||
# path: app/build/outputs/apk/release/${{ env.OUTPUT_NAME }}.apk | ||
# | ||
# - name: Build release AAB | ||
# run: bash ./gradlew bundleRelease --stacktrace | ||
# | ||
# - name: Rename AAB | ||
# run: | ||
# mv "./app/build/outputs/bundle/release/app-release.aab" "./app/build/outputs/bundle/release/${{ env.OUTPUT_NAME }}.aab" | ||
# | ||
# - name: Upload debug AAB | ||
# uses: actions/upload-artifact@v1 | ||
# with: | ||
# name: ${{ env.OUTPUT_NAME }} | ||
# path: app/build/outputs/bundle/release/${{ env.OUTPUT_NAME }}.aab |
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
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