Skip to content

Commit

Permalink
Create build workflows (#7)
Browse files Browse the repository at this point in the history
* Implement workflow to test build apk

* Implement workflow to test build apk

* Fix android api build

* Implement upload artifacts

* Test artifacts

* Implement upload artifacts

* Fix keystore ingore
  • Loading branch information
cp-pratik-k authored Jan 18, 2024
1 parent db6fa91 commit ca5605f
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build

on: push

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
name: Checkout

- uses: subosito/[email protected]
name: Set up Flutter SDK
with:
channel: 'stable'
cache: true

- name: Install dependencies
run: |
cd app
flutter clean
flutter pub get
cd ../data
flutter clean
flutter pub get
cd ../style
flutter clean
flutter pub get
cd ..
- name: Build android APK
run: |
cd app
file='VERSION'
fileData=$(cat $file)
IFS='.'
read -a versionValue <<< "$fileData"
buildNumber=$(( ${versionValue[0]} * 1000000 + ${versionValue[1]} * 10000 + CI_PIPELINE_IID ))
IFS=''
buildName="${versionValue[0]}.${versionValue[1]}.$CI_PIPELINE_IID"
echo "Generating android build $buildName $buildNumber"
flutter build apk --release --build-number=$buildNumber --build-name=$buildName
mv build/app/outputs/apk/release/*.apk .
cd ..
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: cloud-gallery.apk
path: app/*.apk
if-no-files-found: error

1 change: 1 addition & 0 deletions app/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0
3 changes: 1 addition & 2 deletions app/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks

Binary file added app/android/app/dev.jks
Binary file not shown.

0 comments on commit ca5605f

Please sign in to comment.