Skip to content

[FIX] #7 - 일단 ci/cd debug 버전으로 세팅 #58

[FIX] #7 - 일단 ci/cd debug 버전으로 세팅

[FIX] #7 - 일단 ci/cd debug 버전으로 세팅 #58

Workflow file for this run

name: Android CI/CD to Firebase App Distribution
# Develop 브랜치에 push 될 때 확인
on:
push:
branches: [ "develop" ]
workflow_dispatch: # 테스트를 위한 수동 실행 옵션
jobs:
build:
runs-on: ubuntu-latest
env:
BASE_URL: ${{ secrets.API_BASE_URL }}
steps:
- uses: actions/checkout@v4
# 깃허브 runner에서 돌아가는 환경은 java 17버전으로 설정
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
shell: bash
# 환경변수(GOOGLE_SERVICES_JSON) 값의 내용을 기반으로 `app/google-services.json` 생성
- name: Create google-services.json
run: echo "${{ secrets.GOOGLE_SERVICES_JSON }}" > app/google-services.json
# BASE_URL -> local.properties 생성
- name: Create local.properties
run: echo "api.baseurl=$BASE_URL" > $GITHUB_WORKSPACE/local.properties
# 캐시 정리
# - name: Clean Gradle cache
# run: ./gradlew clean
# Generate Keystore File
# - name: Generate Keystore File
# env:
# KEY_STORE: ${{ secrets.APP_KEYSTORE_BASE64 }}
# run: |
# echo $KEY_STORE > ./keystore.b64
# base64 -d -i ./keystore.b64 > ./release.keystore
# Generate keystore.properties
# - name: Generate keystore.properties
# env:
# STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
# KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
# KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
# STORE_FILE: ${{ secrets.STORE_FILE }}
# run: |
# echo storePassword=$STORE_PASSWORD > ./keystore.properties
# echo keyPassword=$KEY_PASSWORD > ./keystore.properties
# echo keyAlias=$KEY_ALIAS > ./keystore.properties
# echo storeFile=$STORE_FILE > ./keystore.properties
# Build APK Release
# - name: Build Release Apk
# run: ./gradlew assembleRelease --stacktrace --warning-mode=all
#
# - name: APK 디렉토리 확인 (디버깅용) / Release
# run: ls -alh app/build/outputs/apk/release/
- name: Build Debug Apk
run: ./gradlew assembleDebug
# - name: APK 디렉토리 확인 (디버깅용) / Debug
# run: ls -alh app/build/outputs/apk/debug/
# Build AAB Release
# - name: Build release Bundle
# run: ./gradlew bundleRelease
# Firebase에 배포
# - name: Upload Firebase App Distribution / Release
# uses: wzieba/Firebase-Distribution-Github-Action@v1
# with:
# appId: ${{secrets.FIREBASE_APP_ID}}
# serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
# groups: swmarastro
# file: app/build/outputs/apk/release/app-release-unsigned.apk
- name: Upload Firebase App Distribution / Debug
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{secrets.FIREBASE_APP_ID}}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: swmarastro
file: app/build/outputs/apk/debug/app-debug.apk