Skip to content

Commit 29050ae

Browse files
authored
feat : app distribution 자동화 git action 추가 (#19)
* Update android.yml (#18) * Update android.yml * Update android.yml * Update android.yml * - * -1 * -2 * -3 * -4 * -5 * -6 * -7 * -8 * -9 * -10 * -11
1 parent 92ff74e commit 29050ae

1 file changed

Lines changed: 45 additions & 18 deletions

File tree

.github/workflows/android.yml

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,52 @@
1-
name: Android CI
1+
name: Build & upload to Firebase App Distribution
22

33
on:
44
push:
5-
branches: [ "deploy" ]
5+
branches: [ deploy ] # dev 브런치에 push가 올 때 이벤트 트리거
6+
workflow_dispatch: # 수동 실행 옵션 (생략가능)
7+
68
jobs:
79
build:
8-
9-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-latest # 이후의 jobs들은 ubuntu의 최신버전에서 실행한다.
1011

1112
steps:
12-
- uses: actions/checkout@v4
13-
- name: set up JDK 11
14-
uses: actions/setup-java@v4
15-
with:
16-
java-version: '11'
17-
distribution: 'temurin'
18-
cache: gradle
19-
- name: log
20-
run: echo "JDK 11 setup complete"
21-
22-
- name: Grant execute permission for gradlew
23-
run: chmod +x gradlew
24-
- name: Build with Gradle
25-
run: ./gradlew build
13+
- uses: actions/checkout@v1
14+
15+
- name: set up JDK 17 # 깃허브 runner에서 돌아가는 환경은 java 17버전으로 설정한다.
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 17
19+
20+
- name: Grant Permission for gradlew # gradlew 에 대한 퍼미션을 허용한다.
21+
run: chmod +x ./gradlew
22+
shell: bash
23+
24+
- name: Decode And Save Keystore Base64 # app.keystoer.jks 키 값을 디코드 해서 app/ksystore.jks로 저장한다. (생략 가능)
25+
run: |
26+
echo "${{ secrets.KEY_STORE_BASE64 }}" | base64 --decode > app/keystore.jks
27+
28+
- name: Create google-services.json
29+
run: |
30+
cat <<EOF > app/google-services.json
31+
${{ secrets.GOOGLE_SERVICES }}
32+
EOF
33+
34+
- name: Create local.properties # (LOCAL_PROPERTIES_CONTENTS)를 기반으로 local.properties를 만들고 keystore.jks 위치를 추가해 준다.
35+
run: |
36+
echo "google-web-client-id=${{ secrets.GOOGLE_WEB_CLIENT_ID }}" > local.properties
37+
echo "store-file=keystore.jks" >> local.properties
38+
echo "store-password=${{ secrets.STORE_PASSWORD }}" >> local.properties
39+
echo "key-password=${{ secrets.KEY_PASSWORD }}" >> local.properties
40+
echo "key-alias=${{ secrets.KEY_ALIAS }}" >> local.properties
41+
42+
- name: Build release # APK를 빌드한다.
43+
run: ./gradlew assembleRelease --no-daemon --parallel --build-cache
44+
45+
46+
- name: Upload to Firebase App Distribution # 파이어베이스에 앱 디스트리 뷰션에 배포한다.
47+
uses: wzieba/Firebase-Distribution-Github-Action@v1
48+
with:
49+
appId: ${{secrets.FIRE_BASE_APP_ID}}
50+
serviceCredentialsFileContent: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
51+
groups: 하나회
52+
file: app/build/outputs/apk/release/app-release.apk

0 commit comments

Comments
 (0)