Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] aab 빌드용 pr 생성 #194

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/auto-tagging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: get latest tag
run: |
latest_tag_version=$(git tag --sort=-v:refname | head -n 1)
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/create_artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up JDK 18
uses: actions/setup-java@v3
with:
Expand All @@ -32,6 +34,8 @@ jobs:

- name: Build with assembleRelease for apk
run: ./gradlew assembleRelease
env:
ci: true

- name: sign apk
id: sign_app
Expand All @@ -58,6 +62,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up JDK 18
uses: actions/setup-java@v3
with:
Expand All @@ -71,6 +77,8 @@ jobs:

- name: Build with bundleRelease for aab
run: ./gradlew bundleRelease
env:
ci: true

- name: sign aab
id: sign_app
Expand Down
6 changes: 5 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
alias(libs.plugins.com.android.application)
Expand All @@ -16,7 +17,7 @@ android {
applicationId = "com.mashup.dorabangs"
minSdk = libs.versions.min.sdk.get().toInt()
targetSdk = libs.versions.target.sdk.get().toInt()
versionCode = libs.versions.version.code.get().toInt()
versionCode = GitUtil.getGitCommitCount(project)
versionName = libs.versions.versionName.get()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -44,6 +45,9 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
if (System.getenv("ci") == null) {
signingConfig = signingConfigs.getByName("debug")
}
}
}
compileOptions {
Expand Down
9 changes: 9 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import org.gradle.kotlin.dsl.`kotlin-dsl`

plugins {
`kotlin-dsl`
}
repositories {
google()
mavenCentral()
}
20 changes: 20 additions & 0 deletions buildSrc/src/main/kotlin/GitUtil.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.io.ByteArrayOutputStream
import org.gradle.api.Project

object GitUtil {
/**
* 익셉션 나오면 1로 세팅돼서
* aab 업로드시에 버전이 겹치다고 나올 것임
* 그 때 default를 바꾸던,,익셉션 안나게 하던,,, 잘 해보도록 해~
*/
fun getGitCommitCount(project: Project): Int {
return runCatching {
val stdout = ByteArrayOutputStream()
project.exec {
commandLine = listOf("git", "rev-list", "--count", "HEAD")
standardOutput = stdout
}
stdout.toString().trim().toInt()
}.getOrDefault(1)
}
}
Loading