Skip to content

Commit e0de396

Browse files
authored
Merge pull request #242 from YAPP-Github/chore/release-cd
[CHORE] release ๋ธŒ๋žœ์น˜์šฉ CI/CD ๋ฐ QA ๋Œ€์‘ ์ „๋žต ์„ค์ •
2 parents c7c2698 + 2763869 commit e0de396

2 files changed

Lines changed: 44 additions & 94 deletions

File tree

โ€Ž.github/workflows/android_cd.ymlโ€Ž

Lines changed: 31 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ name: Orbit CD
33
on:
44
push:
55
branches:
6-
- main
6+
- 'release/**'
77
pull_request:
88
branches:
9-
- main
9+
- 'release/**'
1010

1111
jobs:
1212
cd:
1313
name: Continuous Deployment
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
# 1. Code Checkout
17+
# 1. Checkout
1818
- name: Checkout code
1919
uses: actions/checkout@v4
2020

21-
# 2. Gradle Cache
21+
# 2. Cache Gradle
2222
- name: Cache Gradle dependencies
2323
uses: actions/cache@v4
2424
with:
@@ -29,139 +29,82 @@ jobs:
2929
restore-keys: |
3030
${{ runner.os }}-gradle-
3131
32-
# 3. JDK 17
32+
# 3. Set up JDK 17
3333
- name: Set up JDK 17
3434
uses: actions/setup-java@v4
3535
with:
3636
java-version: 17
3737
distribution: 'corretto'
3838
cache: gradle
3939

40-
# 4. Grant Execute Permission
40+
# 4. Change gradlew permissions
4141
- name: Change gradlew permissions
4242
run: chmod +x gradlew
4343

44-
# 5. Install Firebase CLI
45-
- name: Install Firebase CLI
46-
run: curl -sL https://firebase.tools | bash
47-
48-
# 6. Decode google-services.json for debug
49-
- name: Decode google-services.json (debug)
50-
env:
51-
FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET_DEBUG }}
52-
run: |
53-
mkdir -p app/src/dev
54-
echo $FIREBASE_SECRET | base64 --decode > app/src/dev/google-services.json
55-
56-
# 7. Decode google-services.json for release
44+
# 5. Decode google-services.json (release)
5745
- name: Decode google-services.json (release)
5846
env:
59-
FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET_RELEASE }}
47+
FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET_RELEASE }}
6048
run: echo $FIREBASE_SECRET | base64 --decode > app/google-services.json
6149

62-
# 8. Add Local Properties
50+
# 6. Add Local Properties
6351
- name: Add Local Properties
6452
env:
6553
BASE_URL: ${{ secrets.BASE_URL }}
6654
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
67-
ADMOB_APP_ID_DEBUG: ${{ secrets.ADMOB_APP_ID_DEBUG }}
6855
ADMOB_APP_ID_RELEASE: ${{ secrets.ADMOB_APP_ID_RELEASE }}
69-
ADMOB_AD_UNIT_ID_DEBUG: ${{ secrets.ADMOB_AD_UNIT_ID_DEBUG }}
7056
ADMOB_AD_UNIT_ID_RELEASE: ${{ secrets.ADMOB_AD_UNIT_ID_RELEASE }}
7157
run: |
72-
echo -e "baseUrl=$BASE_URL" > local.properties
73-
echo -e "amplitudeApiKey=$AMPLITUDE_API_KEY" >> local.properties
74-
echo -e "admobAppIdDebug=$ADMOB_APP_ID_DEBUG" >> local.properties
75-
echo -e "admobAppIdRelease=$ADMOB_APP_ID_RELEASE" >> local.properties
76-
echo -e "admobAdUnitIdDebug=$ADMOB_AD_UNIT_ID_DEBUG" >> local.properties
77-
echo -e "admobAdUnitIdRelease=$ADMOB_AD_UNIT_ID_RELEASE" >> local.properties
78-
79-
# 9. Debug Local Properties Check
80-
- name: Debug Local Properties
81-
run: cat local.properties
82-
83-
# 10. Ktlint
84-
- name: Run Ktlint Check
85-
run: ./gradlew ktlintCheck --stacktrace
86-
87-
# 11. Debug APK Build
88-
- name: Build Debug APK
89-
run: ./gradlew assembleDebug --stacktrace
90-
91-
# 12. Release AAB Build
92-
- name: Build Release AAB
93-
run: ./gradlew bundleRelease --stacktrace
58+
echo "baseUrl=$BASE_URL" > local.properties
59+
echo "amplitudeApiKey=$AMPLITUDE_API_KEY" >> local.properties
60+
echo "admobAppIdRelease=$ADMOB_APP_ID_RELEASE" >> local.properties
61+
echo "admobAdUnitIdRelease=$ADMOB_AD_UNIT_ID_RELEASE" >> local.properties
9462
95-
# 13. Release APK Build
63+
# 7. Build Release APK
9664
- name: Build Release APK
9765
run: ./gradlew assembleRelease --stacktrace
9866

99-
# 14. AAB Artifact Upload
100-
- name: Upload Release AAB
101-
uses: actions/upload-artifact@v4
102-
with:
103-
name: release-aab
104-
path: app/build/outputs/bundle/release/app-release.aab
105-
106-
# 15. APK Artifact Upload
67+
# 8. Upload Release APK
10768
- name: Upload Release APK
10869
uses: actions/upload-artifact@v4
10970
with:
11071
name: release-apk
11172
path: app/build/outputs/apk/release/app-release.apk
11273

113-
# 16. Set up Firebase Service Account Credentials
114-
- name: Set up Firebase Service Account Credentials
74+
# 9. Set up Firebase Credentials
75+
- name: Set up Firebase Credentials
11576
env:
11677
GOOGLE_APPLICATION_CREDENTIALS_JSON: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }}
11778
run: |
11879
echo "$GOOGLE_APPLICATION_CREDENTIALS_JSON" | base64 --decode > $HOME/firebase-credentials.json
119-
echo "๐Ÿ”ฅ Firebase Credentials JSON ์ƒ์„ฑ ์™„๋ฃŒ!"
120-
ls -l $HOME/firebase-credentials.json
121-
export GOOGLE_APPLICATION_CREDENTIALS=$HOME/firebase-credentials.json
122-
echo "GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS"
123-
124-
# 17. Firebase CLI ์ธ์ฆ ํ™•์ธ
125-
- name: Check Firebase CLI Authentication
126-
run: |
127-
export GOOGLE_APPLICATION_CREDENTIALS=$HOME/firebase-credentials.json
80+
echo "GOOGLE_APPLICATION_CREDENTIALS=$HOME/firebase-credentials.json" >> $GITHUB_ENV
12881
129-
echo "๐Ÿ“Œ GOOGLE_APPLICATION_CREDENTIALS ์„ค์ • ๊ฐ’:"
130-
echo $GOOGLE_APPLICATION_CREDENTIALS
131-
ls -l $GOOGLE_APPLICATION_CREDENTIALS
132-
133-
echo "๐Ÿ“Œ ํ˜„์žฌ Firebase ํ”„๋กœ์ ํŠธ ๋ชฉ๋ก ํ™•์ธ:"
134-
firebase projects:list || (echo "โŒ Firebase ์ธ์ฆ ์‹คํŒจ!"; exit 1)
82+
# 10. Install Firebase CLI
83+
- name: Install Firebase CLI
84+
run: curl -sL https://firebase.tools | bash
13585

136-
# 18. Firebase App Distribution Upload
86+
# 11. Upload to Firebase App Distribution
13787
- name: Upload APK to Firebase App Distribution
13888
env:
139-
GOOGLE_APPLICATION_CREDENTIALS: $HOME/firebase-credentials.json
89+
GOOGLE_APPLICATION_CREDENTIALS: ${{ env.GOOGLE_APPLICATION_CREDENTIALS }}
14090
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
14191
run: |
142-
echo "๐Ÿ”ฅ FIREBASE_APP_ID ํ™•์ธ: $FIREBASE_APP_ID"
143-
144-
# ๋งŒ์•ฝ FIREBASE_APP_ID๊ฐ€ ์—†์œผ๋ฉด ์—๋Ÿฌ ์ถœ๋ ฅ ํ›„ ์ข…๋ฃŒ
14592
if [ -z "$FIREBASE_APP_ID" ]; then
146-
echo "โŒ ERROR: FIREBASE_APP_ID๊ฐ€ ์„ค์ •๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. GitHub Secrets์—์„œ ํ™•์ธํ•˜์„ธ์š”."
93+
echo "โŒ ERROR: FIREBASE_APP_ID is missing!"
14794
exit 1
14895
fi
14996
150-
# GOOGLE_APPLICATION_CREDENTIALS๋ฅผ ๋‹ค์‹œ ์„ค์ •
151-
export GOOGLE_APPLICATION_CREDENTIALS=$HOME/firebase-credentials.json
152-
echo "GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS"
153-
15497
firebase appdistribution:distribute app/build/outputs/apk/release/app-release.apk \
155-
--app "$FIREBASE_APP_ID" \
156-
--release-notes "๐Ÿš€ ์ƒˆ๋กœ์šด ๋ฐ๋ชจ ๋ฒ„์ „์ด ๋ฐฐํฌ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!" \
157-
--groups "orbit-tester-group"
98+
--app "$FIREBASE_APP_ID" \
99+
--release-notes "๐Ÿš€ release ๋ธŒ๋žœ์น˜์—์„œ ์ƒˆ ๋นŒ๋“œ๊ฐ€ ์—…๋กœ๋“œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!" \
100+
--groups "orbit-tester-group"
158101
159-
# 19. Notify Discord
102+
# 12. Notify Discord
160103
- name: Notify Discord
161104
env:
162105
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
163106
run: |
164107
curl -H "Content-Type: application/json" \
165-
-X POST \
166-
-d '{"content": "๐Ÿš€ ์ƒˆ๋กœ์šด ๋ฐ๋ชจ ๋ฒ„์ „์ด Firebase App Distribution์— ์—…๋กœ๋“œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!\nAPK ๋‹ค์šด๋กœ๋“œ: https://appdistribution.firebase.google.com"}' \
167-
$DISCORD_WEBHOOK_URL
108+
-X POST \
109+
-d '{"content": "๐Ÿš€ Firebase App Distribution์— ์ƒˆ APK๊ฐ€ ์—…๋กœ๋“œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!\n๐Ÿ”— ๋‹ค์šด๋กœ๋“œ ๋งํฌ: https://appdistribution.firebase.google.com"}' \
110+
$DISCORD_WEBHOOK_URL

โ€Ž.github/workflows/android_ci.ymlโ€Ž

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
name: Orbit CI
22

33
on:
4-
pull_request:
5-
branches: [develop]
6-
paths:
7-
- 'app/**'
8-
- 'build.gradle'
9-
- '**/*.kt'
4+
pull_request:
5+
branches: [develop]
6+
paths:
7+
- '**/*.kt'
8+
- 'build.gradle'
9+
- 'app/**'
10+
push:
11+
branches:
12+
- 'release/**'
13+
paths:
14+
- '**/*.kt'
15+
- 'build.gradle'
16+
- 'app/**'
1017

1118
jobs:
1219
build:

0 commit comments

Comments
ย (0)