Skip to content

Commit

Permalink
👷 CI/CD scripts for Android builds (#15)
Browse files Browse the repository at this point in the history
* 👷 Separated dev and prod workflows

* 👷 Updated name of artifact

* 👷 Updated setup java action version
  • Loading branch information
devaryakjha authored Sep 19, 2023
1 parent 0a0d5f4 commit 057f992
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 17 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
name: Varnasi Mobile App Build
run-name: ${{ github.actor }} pushed to "${{ github.ref_name }}" triggering mobile app build 🚀
run-name: ${{ github.actor }} pushed to "${{ github.ref_name }}" triggering dev build 🚀
on:
push:
branches:
branches-ignore:
- main
- develop

env:
PROPERTIES_PATH: "./android/key.properties"

jobs:
Androi-App-Build:
name: Android App Build
name: Android App Dev Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
Expand All @@ -29,22 +28,11 @@ jobs:
echo storeFile=\${{ secrets.STORE_FILE }} >> ${{env.PROPERTIES_PATH}}
- run: echo "${{ secrets.KEYSTORE }}" | base64 --decode > android/app/key.jks
- run: flutter pub get
- name: Flutter Prod Build
if: github.ref_name == 'main'
run: flutter build apk --flavor prod
- name: Flutter Dev Build
if: github.ref_name != 'main'
run: flutter build apk --flavor dev
# Make appbundle downloadable
- name: Upload Dev artifacts
uses: actions/upload-artifact@v3
if: github.ref_name != 'main'
with:
name: apk-dev-release.apk
name: dev-release
path: build/app/outputs/flutter-apk/app-dev-release.apk
- name: Upload Prod artifacts
uses: actions/upload-artifact@v3
if: github.ref_name == 'main'
with:
name: apk-prod-release.apk
path: build/app/outputs/flutter-apk/app-prod-release.apk
37 changes: 37 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Varnasi Mobile App Build
run-name: ${{ github.actor }} pushed to "${{ github.ref_name }}" triggering production build 🚀
on:
push:
branches:
- main

env:
PROPERTIES_PATH: "./android/key.properties"

jobs:
Androi-App-Build:
name: Android App Prod Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
- uses: subosito/flutter-action@v2
with:
channel: "stable"
- run: |
echo keyPassword=\${{ secrets.KEY_PASSWORD }} >> ${{env.PROPERTIES_PATH}}
echo storePassword=\${{ secrets.STORE_PASSWORD }} >> ${{env.PROPERTIES_PATH}}
echo keyAlias=\${{ secrets.KEY_ALIAS }} >> ${{env.PROPERTIES_PATH}}
echo storeFile=\${{ secrets.STORE_FILE }} >> ${{env.PROPERTIES_PATH}}
- run: echo "${{ secrets.KEYSTORE }}" | base64 --decode > android/app/key.jks
- run: flutter pub get
- name: Flutter Prod Build
run: flutter build apk --flavor prod
- name: Upload Prod artifacts
uses: actions/upload-artifact@v3
with:
name: prod-release
path: build/app/outputs/flutter-apk/app-prod-release.apk
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@
- 📦 Updating dependencies
- 🎨 Improving code structure/formatting
- 🎉 Initial commit
- 👷 Build changes

0 comments on commit 057f992

Please sign in to comment.