From 12f26c7745966e8cef429295b5e85aec3646c9f4 Mon Sep 17 00:00:00 2001 From: Pratik-canopas Date: Wed, 17 Jan 2024 17:41:59 +0530 Subject: [PATCH] Implement workflow to test build apk --- .github/workflows/build.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 810dfe0..e2b2121 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,9 @@ -name: Analyze +name: Build on: push jobs: - analyze: + build: runs-on: ubuntu-latest steps: @@ -32,16 +32,18 @@ jobs: cd .. - - name: Lint test + - name: Build android APK run: | cd app - dart analyze --fatal-infos - - cd ../data - dart analyze --fatal-infos - - cd ../style - dart analyze --fatal-infos - + file='VERSION' + fileData=`cat $file` + IFS='.' + read -a versionValue <<< "$fileData" + buildNumber=$(expr `expr ${versionValue[0]} \* 1000000` + `expr ${versionValue[1]} \* 10000` + ${CI_PIPELINE_IID}) + IFS='' + buildName="${versionValue[0]}.${versionValue[1]}.$CI_PIPELINE_IID" + echo "Generating android build $buildName $buildNumber" + flutter build apk --flavor prod --release --build-number=$buildNumber --build-name=$buildName + mv build/app/outputs/apk/release/*.apk . cd .. - +