-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (95 loc) · 3.77 KB
/
android_cd.yml
File metadata and controls
112 lines (95 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: DATEROAD CD
on:
push:
branches:
- main
defaults:
run:
shell: bash
working-directory: .
jobs:
build:
name: CD
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Change gradlew permissions
run: chmod +x ./gradlew
- name: Touch local properties
run: touch local.properties
- name: Decode google-services.json
env:
FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET }}
run: echo "$FIREBASE_SECRET" > app/google-services.json
- name: Access local properties
env:
HFM_BASE_URL: ${{ secrets.BASE_URL }}
KAKAO_NATIVE_APP_KEY_MANIFEST: ${{ secrets.KAKAO_NATIVE_APP_KEY }}
KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }}
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
GOOGLE_ADS_API_ID: ${{ secrets.GOOGLE_ADS_API_ID }}
GOOGLE_ADS_API_ID_MANIFEST: ${{ secrets.GOOGLE_ADS_API_ID_MANIFEST }}
run: |
echo "dev.base.url=\"$HFM_BASE_URL\"" >> local.properties
echo "kakao.native.app.key.manifest=\"$KAKAO_NATIVE_APP_KEY_MANIFEST\"" >> local.properties
echo "kakao.native.app.key=\"$KAKAO_NATIVE_APP_KEY\"" >> local.properties
echo "amplitude.dev.api.key=\"$AMPLITUDE_API_KEY\"" >> local.properties
echo "google.ads.api.id=\"$GOOGLE_ADS_API_ID\"" >> local.properties
echo "google.ads.api.id.manifest=\"$GOOGLE_ADS_API_ID_MANIFEST\"" >> local.properties
- name: Decode Keystore
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > app/date_road.keystore
- name: Export signing environment
run: |
echo "STORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }}" >> $GITHUB_ENV
echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> $GITHUB_ENV
echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> $GITHUB_ENV
- name: Build Signed Release APK
run: ./gradlew :app:assembleRelease
- name: Upload Signed APK
uses: actions/upload-artifact@v4
with:
name: release-apk
path: ./app/build/outputs/apk/release/app-release.apk
- name: Build Signed Release AAB
run: ./gradlew :app:bundleRelease
- name: Upload Signed AAB
uses: actions/upload-artifact@v4
with:
name: release-aab
path: ./app/build/outputs/bundle/release/app-release.aab
- name: Discord Notify - Success
if: ${{ success() }}
uses: sarisia/actions-status-discord@v1
with:
title: ✅ Release Test가 완료되었습니다! 🔥
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }}
color: B7FF1D
username: DATEROAD-ANDROID 🍫
content: |
Release Test가 완료되었습니다!
[❇️ APK 다운로드](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
[📦 AAB 다운로드](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
- name: Discord Notify - Failure
if: ${{ failure() }}
uses: sarisia/actions-status-discord@v1
with:
title: ❌ Release Test Failed ❌
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }}
color: FF0000
username: DATEROAD-ANDROID 🍫
content: 에러를 확인해 주세요 🫨