-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (106 loc) · 4.47 KB
/
android-ci.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Android CI
on:
push:
branches:
- 'release/**'
jobs:
release_deploy_job:
if: github.ref == 'refs/heads/release/release'
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create API Certificate
run: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > ./local.properties
echo "native_app_key=\"${{ secrets.NATIVE_APP_KEY }}\"" >> ./local.properties
echo "CLOVA_OCR_DOCUMENT_SECRET=\"${{ secrets.CLOVA_OCR_DOCUMENT_SECRET }}\"" >> ./local.properties
echo "CLOVA_OCR_DOCUMENT_BASEURL=\"${{ secrets.CLOVA_OCR_DOCUMENT_BASEURL }}\"" >> ./local.properties
- name: Clean Build
run: ./gradlew clean
- name: Decode Service Account Key
run: |
echo "${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_KEY }}" | base64 --decode > ./app/service_account_key.json
- name: Decode Keystore File
run: |
echo "${{ secrets.KEYSTORE_FILE }}" | base64 --decode > ./app/moneymong_keystore.jks
- name: Install Dependencies
run: |
gem install bundler
bundle install
- name: Build & Deploy Android release
env:
SERVICE_ACCOUNT_KEY: ${{ github.workspace }}/app/service_account_key.json
KEYSTORE_FILE: ${{ github.workspace }}/app/moneymong_keystore.jks
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
CWD: ${{ github.workspace }}
run: bundle exec fastlane deploy
- name: Remove Credential
run: |
rm ./app/service_account_key.json
rm ./app/moneymong_keystore.jks
rm ./local.properties
dev_deploy_job:
if: contains(github.ref, 'release-')
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create API Certificate
run: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > ./local.properties
echo "native_app_key=\"${{ secrets.NATIVE_APP_KEY }}\"" >> ./local.properties
echo "CLOVA_OCR_DOCUMENT_SECRET=\"${{ secrets.CLOVA_OCR_DOCUMENT_SECRET }}\"" >> ./local.properties
echo "CLOVA_OCR_DOCUMENT_BASEURL=\"${{ secrets.CLOVA_OCR_DOCUMENT_BASEURL }}\"" >> ./local.properties
- name: Clean Build
run: ./gradlew clean
- name: Decode Service Account Key
run: |
echo "${{ secrets.FIREBASE_SERVICE_ACCOUNT_KEY }}" | base64 --decode > ./app/firebase_credentials.json
- name: Decode Keystore File
run: |
echo "${{ secrets.DEBUG_KEYSTORE_FILE }}" | base64 --decode > ./app/debug_keystore.jks
- name: Extract Key Hash
run: |
keytool -exportcert -alias ${{ secrets.DEBUG_KEYSTORE_KEY_ALIAS }} -keystore ./app/debug_keystore.jks -storepass ${{ secrets.DEBUG_KEYSTORE_PASSWORD }} | openssl sha1 -binary | openssl base64
shell: bash
- name: Install Dependencies
run: |
gem install bundler
bundle install
- name: Build & Deploy Distribute
env:
FIREBASE_CREDENTIALS: ${{ github.workspace }}/app/firebase_credentials.json
DEBUG_KEYSTORE_FILE: ${{ github.workspace }}/app/debug_keystore.jks
DEBUG_KEYSTORE_PASSWORD: ${{ secrets.DEBUG_KEYSTORE_PASSWORD }}
DEBUG_KEYSTORE_KEY_ALIAS: ${{ secrets.DEBUG_KEYSTORE_KEY_ALIAS }}
DEBUG_KEYSTORE_KEY_PASSWORD: ${{ secrets.DEBUG_KEYSTORE_KEY_PASSWORD }}
APP_ID: ${{ secrets.FIREBASE_TB_APP_ID }}
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
CWD: ${{ github.workspace }}
run: bundle exec fastlane distribute
- name: Remove Credential
run: |
rm ./local.properties
rm ./app/firebase_credentials.json
rm ./app/debug_keystore.jks