[CI/CD] Github Actions Test #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI/CD to Firebase App Distribution | |
# Develop 브랜치에 push 또는 PR이 올 때 확인 | |
on: | |
push: | |
branches: [ "Develop" ] | |
pull_request: | |
branches: [ "Develop" ] | |
workflow_dispatch: # 테스트를 위한 수동 실행 옵션 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
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 | |
# 환경변수(GOOGLE_SERVICES_JSON) 값의 내용을 기반으로 `app/google-services.json` 생성 | |
- name: Create google-services.json | |
run: echo "${{ secrets.GOOGLE_SERVICES_JSON }}" > app/google-services.json | |
# (LOCAL_PROPERTIES_CONTENTS)를 기반으로 local.properties 생성 | |
# 아직 추가할 Key가 없어서 주석 처리 | |
#- name: Create local.properties | |
# run: echo "$LOCAL_PROPERTIES_CONTENTS" > local.properties | |
# Build APK Release | |
- name: Build release Apk | |
run: ./gradlew assembleDebug | |
# Firebase에 배포 | |
- name: Upload Firebase App Distribution | |
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-debug.apk | |
# Build AAB Release | |
- name: Build release Bundle | |
run: ./gradlew bundleRelease |