-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (73 loc) ยท 3.57 KB
/
winey-cd.yml
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
# JVM ์ต์
์ ์ค์ , ์ต๋ ํ ๋ฉ๋ชจ๋ฆฌ๋ฅผ 4GB๋ก
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false"
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
# main, develop ๋ธ๋์น์ PR์ ์ฌ๋ฆด ์ ํธ๋ฆฌ๊ฑฐ
on:
pull_request:
branches:
- develop
- main
jobs:
cd-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Generate winey.keystore.jks
run: echo '${{ secrets.WINEY_KEYSTORE }}' | base64 -d > ./app/winey.jks
- name: Generate local.properties
env:
AUTH_BASE_URL: ${{ secrets.AUTH_BASE_URL }}
KAKAO_NATIVE_KEY: ${{ secrets.KAKAO_NATIVE_KEY }}
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
echo "auth.base.url=$AUTH_BASE_URL" >> ./local.properties
echo "kakao.native.key=$KAKAO_NATIVE_KEY" >> ./local.properties
echo "amplitude.api.key=$AMPLITUDE_API_KEY" >> ./local.properties
echo "kakaoNativeKey=$KAKAO_NATIVE_KEY" >> ./local.properties
echo "keyAlias=$KEY_ALIAS" >> ./local.properties
echo "keyPassword=$KEY_PASSWORD" >> ./local.properties
echo "storePassword=$STORE_PASSWORD" >> ./local.properties
- name: Create Google Services JSON File
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $GOOGLE_SERVICES_JSON > ./app/google-services.json
# PR ์ ๋ชฉ์์ release v*.*.* ํ์์ ๋ฒ์ ์ ์ถ์ถ
- name: Extract Version Name
run: echo "##[set-output name=version;]v$(echo '${{ github.event.pull_request.title }}' | grep -oP 'release v\K[0-9]+\.[0-9]+\.[0-9]+')"
id: extract_version
- name: Build Release APK
run: |
./gradlew :app:assembleRelease
# GitHub Actions Artifacts์ ๋ฆด๋ฆฌ์ฆ apk ์ถ์ถ
- name: Upload Release Build to Artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: app/build/outputs/apk/release/
if-no-files-found: error
- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.extract_version.outputs.version }}
release_name: ${{ steps.extract_version.outputs.version }}
generate_release_notes: true
files: |
app/build/outputs/apk/release/app-release.apk
- name: Upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{secrets.FIREBASE_APP_ID}}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: testers
file: app/build/outputs/apk/release/app-release.apk