-
Notifications
You must be signed in to change notification settings - Fork 1
121 lines (103 loc) · 4.06 KB
/
main_merge_builder.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
name: Wable Release Note
on:
push:
branches: [ main ]
defaults:
run:
shell: bash
working-directory: .
jobs:
build:
name: Generate Release APK, Note
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Add Network Base Url
env:
WABLE_DEV_BASE_URL: ${{ secrets.WABLE_DEV_BASE_URL }}
WABLE_REL_BASE_URL: ${{ secrets.WABLE_REL_BASE_URL }}
run: |
echo wable.dev.base.url=$WABLE_DEV_BASE_URL >> ./local.properties
echo wable.rel.base.url=$WABLE_REL_BASE_URL >> ./local.properties
- name: Access Google Services JSON (Debug)
env:
GOOGLE_SERVICES_JSON_DEV: ${{ secrets.GOOGLE_SERVICES_JSON_DEV }}
run: echo $GOOGLE_SERVICES_JSON_DEV | base64 -di > ./app/src/debug/google-services.json
- name: Access Google Services JSON (Release)
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $GOOGLE_SERVICES_JSON | base64 -di > ./app/src/release/google-services.json
- name: Verify google-services.json files
run: |
ls -l ./app/src/debug/google-services.json
ls -l ./app/src/release/google-services.json
- name: Access Keystore
env:
DEBUG_KEY_STORE: ${{ secrets.DEBUG_KEY_STORE }}
RELEASE_JKS: ${{ secrets.RELEASE_JKS }}
RELEASE_KEY_STORE_PROPERTIES: ${{ secrets.RELEASE_KEY_STORE_PROPERTIES }}
run: |
echo $RELEASE_JKS | base64 -di > ./app/keystore/release.jks
echo $RELEASE_KEY_STORE_PROPERTIES | base64 -di > ./keystore.properties
echo $DEBUG_KEY_STORE | base64 -di > ./app/keystore/debug.keystore
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Extract Version Name
run: |
VERSION=$(grep -oP 'appVersion\s*=\s*"\K[0-9]+\.[0-9]+\.[0-9]+' gradle/libs.versions.toml)
echo "##[set-output name=version;]v$VERSION"
id: extract_version
- name: Build release APK
run: ./gradlew assembleRelease --stacktrace
- name: Upload Release Build to APK
uses: actions/upload-artifact@v4
with:
name: release-apk
path: app/build/outputs/apk/release/
if-no-files-found: error
- name: Create Github Release note
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: On Success, Notify in Slack
if: ${{ success() }}
uses: MeilCli/slack-upload-file@v3
with:
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
channel_id: ${{ secrets.SLACK_GENERAL_CHANNEL_ID }}
file_path: 'app/build/outputs/apk/release/app-release.apk'
file_name: 'WABLE-ANDROID.apk'
file_type: 'apk'
initial_comment: '💟 최종 Release가 완료되었습니다 💟'
- name: On Failed, Notify in Slack
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_TITLE: '🚫 Release PR check Failed 🚫'
SLACK_COLOR: '#FF0000'
MSG_MINIMAL: true
SLACK_USERNAME: Wable Android
SLACK_MESSAGE: '️🚫⚠️ Release PR 에러 ️⚠️🚫'