Skip to content

Commit

Permalink
Merge branch 'feat/cicd-firebase' of https://github.com/Team-Never-La…
Browse files Browse the repository at this point in the history
…nd/ThinkerBell-Android into feat/cicd-firebase
  • Loading branch information
moondev03 committed Sep 4, 2024
2 parents 827a4da + 7aa1e6d commit 9fd23f6
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/versioning-and-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Versioning, Build And Deployment to Firebase App Distribution
on:
push:
branches: [ feat/cicd-firebase ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
env:
LOCAL_PROPERTIES_CONTENTS: ${{ secrets.LOCAL_PROPERTIES_CONTENTS }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
VERSION_CODE: ${{ github.run_number }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'

- name: Grant execute permission for gradlew
run: chmod +x ./ThinkerBell/gradlew

- name: Create google-services.json
run: echo "$GOOGLE_SERVICES_JSON" > ./ThinkerBell/presentation/google-services.json

- name: Create local.properties
run: echo "$LOCAL_PROPERTIES_CONTENTS" > ./ThinkerBell/local.properties

- name: Decode and save keystore
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > ./ThinkerBell/presentation/keystore.jks

- name: Verify keystore
run: |
ls -alh ./ThinkerBell/presentation/
echo "Checking JKS format..."
keytool -list -v -keystore ./ThinkerBell/presentation/keystore.jks -storetype JKS || echo "JKS format verification failed"
- name: Build release APK
run: |
cd ./ThinkerBell
./gradlew assembleRelease -PversionCode=$VERSION_CODE
- name: Upload to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: Team-NeverLand
file: ./ThinkerBell/presentation/build/outputs/apk/release/ThinkerBell-release.apk

0 comments on commit 9fd23f6

Please sign in to comment.