From 43c9dbe1392b66a3547942f9c7a6808c36d6392d Mon Sep 17 00:00:00 2001 From: MunJangHun <105299421+moondev03@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:05:27 +0900 Subject: [PATCH 1/2] Create versioning-and-deployment.yml --- .../workflows/versioning-and-deployment.yml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/versioning-and-deployment.yml diff --git a/.github/workflows/versioning-and-deployment.yml b/.github/workflows/versioning-and-deployment.yml new file mode 100644 index 0000000..55f0400 --- /dev/null +++ b/.github/workflows/versioning-and-deployment.yml @@ -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/app/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/app/keystore.jks + + - name: Verify keystore + run: | + ls -alh ./ThinkerBell/app/ + echo "Checking JKS format..." + keytool -list -v -keystore ./ThinkerBell/app/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/app/build/outputs/apk/release/ThinkerBell-release.apk From 7aa1e6d47e012f5754bc6e2708f77bc8b83a92d0 Mon Sep 17 00:00:00 2001 From: MunJangHun <105299421+moondev03@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:07:02 +0900 Subject: [PATCH 2/2] Update versioning-and-deployment.yml --- .github/workflows/versioning-and-deployment.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/versioning-and-deployment.yml b/.github/workflows/versioning-and-deployment.yml index 55f0400..066a684 100644 --- a/.github/workflows/versioning-and-deployment.yml +++ b/.github/workflows/versioning-and-deployment.yml @@ -25,19 +25,19 @@ jobs: run: chmod +x ./ThinkerBell/gradlew - name: Create google-services.json - run: echo "$GOOGLE_SERVICES_JSON" > ./ThinkerBell/app/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/app/keystore.jks + run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > ./ThinkerBell/presentation/keystore.jks - name: Verify keystore run: | - ls -alh ./ThinkerBell/app/ + ls -alh ./ThinkerBell/presentation/ echo "Checking JKS format..." - keytool -list -v -keystore ./ThinkerBell/app/keystore.jks -storetype JKS || echo "JKS format verification failed" + keytool -list -v -keystore ./ThinkerBell/presentation/keystore.jks -storetype JKS || echo "JKS format verification failed" - name: Build release APK run: | @@ -50,4 +50,4 @@ jobs: appId: ${{ secrets.FIREBASE_APP_ID }} serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} groups: Team-NeverLand - file: ./ThinkerBell/app/build/outputs/apk/release/ThinkerBell-release.apk + file: ./ThinkerBell/presentation/build/outputs/apk/release/ThinkerBell-release.apk