Skip to content

Commit

Permalink
Set up CI/CD for android
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sneha-s committed Apr 4, 2024
1 parent 7a77e52 commit 5cfdd67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ jobs:
APKSIGN_KEY_PASS: ${{ secrets.APKSIGN_KEY_PASS }}

run: |
echo $APKSIGN_KEYSTORE_BASE64 | base64 -di > release.jks
export APKSIGN_KEYSTORE=`pwd`/release.jks
cd khelo
file='VERSION'
fileData=`cat $file`
Expand All @@ -66,8 +68,7 @@ jobs:
IFS=''
buildName="${versionValue[0]}.${versionValue[1]}.${{ github.run_number }}"
echo "Generating android build $buildName $buildNumber"
echo $APKSIGN_KEYSTORE_BASE64 | base64 -di > release.jks
export APKSIGN_KEYSTORE=`pwd`/release.jks
cd android
flutter build apk --release --build-number=$buildNumber --build-name=$buildName
mv build/app/outputs/apk/release/Khelo*.apk .
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/android_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,18 @@ jobs:
APKSIGN_KEY_PASS: ${{ secrets.APKSIGN_KEY_PASS }}

run: |
echo $APKSIGN_KEYSTORE_BASE64 | base64 -di > release.jks
export APKSIGN_KEYSTORE=`pwd`/release.jks
cd khelo
file='VERSION'
fileData=`cat $file`
IFS='.'
read -a versionValue <<< "$fileData"
buildNumber=$(( ${versionValue[0]} * 1000000 + ${versionValue[1]} * 10000 + ${{ github.run_number }} ))
IFS=''
buildName="${versionValue[0]}.${versionValue[1]}.${{ github.run_number }}"
echo "Generating android build $buildName $buildNumber"
echo $APKSIGN_KEYSTORE_BASE64 | base64 -di > release.jks
export APKSIGN_KEYSTORE=`pwd`/release.jks
cd khelo/android
echo "Generating android build $buildName $buildNumber"
cd android
gem install bundler -v 2.4.22
bundle install
echo $APP_PLAY_SERVICE_JSON | base64 --decode > google_play_api_key.json
Expand Down

0 comments on commit 5cfdd67

Please sign in to comment.