Skip to content

Commit 01c6e09

Browse files
authored
Merge pull request #46 from Nexters/add-cd
release 빌드 워크플로 작성
2 parents 05917d0 + b967756 commit 01c6e09

File tree

5 files changed

+70
-30
lines changed

5 files changed

+70
-30
lines changed

.github/workflows/cd-release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: android-cd
2+
on:
3+
push:
4+
tags:
5+
- 'release*'
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: macos-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Create Google Services JSON File
16+
env:
17+
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
18+
run: |
19+
echo "$GOOGLE_SERVICES_JSON" > google-services.json.b64
20+
base64 -d -i google-services.json.b64 > ./app/google-services.json
21+
22+
- name: Create LocalProperites
23+
env:
24+
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
25+
TUK_BASE_URL: ${{ secrets.TUK_BASE_URL }}
26+
run: |
27+
echo GOOGLE_CLIENT_ID=\"GOOGLE_CLIENT_ID\" > ./local.properties
28+
echo TUK_BASE_URL=\"TUK_BASE_URL\" >> ./local.properties
29+
30+
31+
- name: Grant execute permission for gradlew
32+
run: chmod +x gradlew
33+
34+
- name: Build apk
35+
run: ./gradlew assembleProductionRelease
36+
37+
- name: Sign app APK
38+
uses: r0adkll/sign-android-release@v1
39+
# ID used to access action output
40+
id: sign_app
41+
with:
42+
releaseDirectory: app/build/outputs/apk/production/release
43+
signingKeyBase64: ${{ secrets.KEYSTORE_BASE64 }}
44+
alias: ${{ secrets.KEYSTORE_ALIAS }}
45+
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
46+
keyPassword: ${{ secrets.KEYSTORE_PASSWORD }}
47+
env:
48+
# override default build-tools version (29.0.3) -- optional
49+
BUILD_TOOLS_VERSION: "34.0.0"
50+
51+
- name: Upload .aab as artifact
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: app-bundle
55+
path: ${{steps.sign_app.outputs.signedReleaseFile}}

.github/workflows/ci-for-test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ jobs:
2626
run: |
2727
echo "TUK_BASE_URL=KEY" >> local.properties
2828
echo "GOOGLE_CLIENT_ID=KEY" >> local.properties
29-
echo "TUK_SENT_PROPOSAL_URL=KEY" >> local.properties
30-
echo "TUK_PROPOSALS_URL" >> local.properties
31-
echo "TUK_INVITE_GATHERING_URL" >> local.properties
32-
echo "TUK_COMPLETE_PROPOSAL_URL" >> local.properties
3329
3430
- name: Set up JDK 21
3531
uses: actions/setup-java@v3

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,5 @@ google-services.json
171171
/.idea/other.xml
172172
/.idea/kotlinc.xml
173173

174-
.b64
174+
*.b64
175+
*.jks

app/src/main/java/com/plottwist/tuk/config/WebUrlConfigImpl.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import javax.inject.Inject
66

77
class WebUrlConfigImpl @Inject constructor() : WebUrlConfig {
88
override val sentProposalsUrl: String
9-
get() = BuildConfig.TUK_SENT_PROPOSAL_URL
9+
get() = "https://www.tuk.kr/gathering/{gatheringId}/invites"
1010
override val proposalsUrl: String
11-
get() = BuildConfig.TUK_PROPOSALS_URL
11+
get() = "https://www.tuk.kr/gathering/{gatheringId}/invites"
1212
override val inviteGatheringUrl: String
13-
get() = BuildConfig.TUK_INVITE_GATHERING_URL
13+
get() = "https://www.tuk.kr/invite/gathering/{gatheringId}"
1414
override val completeProposalUrl: String
15-
get() = BuildConfig.TUK_COMPLETE_PROPOSAL_URL
15+
get() = "https://www.tuk.kr/invite/meet/{meetId}"
1616
}

build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@ class AndroidApplicationConventionPlugin: Plugin<Project> {
2121
configureDefaultConfig()
2222

2323
buildTypes {
24+
getByName("debug") {
25+
isDebuggable = true
26+
isMinifyEnabled = false
27+
signingConfig = signingConfigs.getByName("debug")
28+
}
2429
getByName("release") {
30+
isDebuggable = false
31+
isMinifyEnabled = true
32+
isShrinkResources = true
33+
2534
proguardFiles(
2635
getDefaultProguardFile("proguard-android-optimize.txt"),
2736
"proguard-rules.pro"
@@ -46,27 +55,6 @@ class AndroidApplicationConventionPlugin: Plugin<Project> {
4655
"GOOGLE_CLIENT_ID",
4756
"\"${localProperties.getProperty("GOOGLE_CLIENT_ID")}\""
4857
)
49-
buildConfigField(
50-
"String",
51-
"TUK_SENT_PROPOSAL_URL",
52-
"\"${localProperties.getProperty("TUK_SENT_PROPOSAL_URL")}\""
53-
)
54-
buildConfigField(
55-
"String",
56-
"TUK_PROPOSALS_URL",
57-
"\"${localProperties.getProperty("TUK_PROPOSALS_URL")}\""
58-
)
59-
buildConfigField(
60-
"String",
61-
"TUK_INVITE_GATHERING_URL",
62-
"\"${localProperties.getProperty("TUK_INVITE_GATHERING_URL")}\""
63-
)
64-
buildConfigField(
65-
"String",
66-
"TUK_COMPLETE_PROPOSAL_URL",
67-
"\"${localProperties.getProperty("TUK_COMPLETE_PROPOSAL_URL")}\""
68-
)
69-
7058
}
7159
}
7260
}

0 commit comments

Comments
 (0)