Skip to content

Commit

Permalink
Update CI_STORE_DEPLOY_ANDROID.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
BerkSpar authored Sep 22, 2024
1 parent b9c118b commit 507ee5b
Showing 1 changed file with 33 additions and 16 deletions.
49 changes: 33 additions & 16 deletions .github/workflows/CI_STORE_DEPLOY_ANDROID.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ on:
branches: [main]

jobs:
store_deploy_android:
name: android store release
setup:
name: Setup Environment
runs-on: ubuntu-latest
env:
JAVA_VERSION: 17.0
FLUTTER_VERSION: 3.24.3
AAB_PATH: build/app/outputs/bundle/release/app-release.aab
KEYSTORE_PATH: android/upload-keystore.jks
KEY_PROPS_PATH: android/key.properties
SERVICE_ACCOUNT_PATH: store_credentials.json
PACKAGE_NAME: tech.bunnie.hub_finder
steps:
- name: Checkout the code
uses: actions/checkout@v3
Expand Down Expand Up @@ -47,19 +42,18 @@ jobs:
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ env.FLUTTER_VERSION }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}

- name: Decode Android keystore
run: echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 --decode > ${{ env.KEYSTORE_PATH }}

- name: Decode Android key properties
run: echo "${{ secrets.ANDROID_KEY_PROPERTIES }}" | base64 --decode > ${{ env.KEY_PROPS_PATH }}

- name: Decode Android Service Account
run: echo "${{ secrets.PRODUCTION_CREDENTIAL_FILE }}" | base64 --decode > ${{ env.SERVICE_ACCOUNT_PATH }}

- name: Run flutter pub get
run: flutter pub get

lint_test:
name: Test and Lint
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout the code
uses: actions/checkout@v3

- name: 📦 Install dependencies
run: flutter pub get

Expand All @@ -69,6 +63,29 @@ jobs:
- name: 📉 Run all app tests
run: flutter test

deploy:
name: Deploy to Play Store
runs-on: ubuntu-latest
env:
AAB_PATH: build/app/outputs/bundle/release/app-release.aab
KEYSTORE_PATH: android/upload-keystore.jks
KEY_PROPS_PATH: android/key.properties
SERVICE_ACCOUNT_PATH: store_credentials.json
PACKAGE_NAME: tech.bunnie.hub_finder
needs: lint_test
steps:
- name: Checkout the code
uses: actions/checkout@v3

- name: Decode Android keystore
run: echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 --decode > ${{ env.KEYSTORE_PATH }}

- name: Decode Android key properties
run: echo "${{ secrets.ANDROID_KEY_PROPERTIES }}" | base64 --decode > ${{ env.KEY_PROPS_PATH }}

- name: Decode Android Service Account
run: echo "${{ secrets.PRODUCTION_CREDENTIAL_FILE }}" | base64 --decode > ${{ env.SERVICE_ACCOUNT_PATH }}

- name: Build aab
run: flutter build appbundle

Expand Down

0 comments on commit 507ee5b

Please sign in to comment.