@@ -3,22 +3,22 @@ name: Orbit CD
33on :
44 push :
55 branches :
6- - main
6+ - ' release/** '
77 pull_request :
88 branches :
9- - main
9+ - ' release/** '
1010
1111jobs :
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
0 commit comments