diff --git a/.github/workflows/develop_branch.yml b/.github/workflows/develop_branch.yml index 7979bc9e..1af3e99b 100644 --- a/.github/workflows/develop_branch.yml +++ b/.github/workflows/develop_branch.yml @@ -14,15 +14,29 @@ jobs: - name: check out repository uses: actions/checkout@v4 + - name: Decode Keystore + env: + RELEASE_STORE_BASE_64: ${{ secrets.RELEASE_STORE_BASE_64 }} + run: | + echo $RELEASE_STORE_BASE_64 > encoded_keystore.txt + base64 --decode encoded_keystore.txt > release.jks + - name: Generate local.properties env: KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }} BITNAGIL_DEV_URL: ${{ secrets.BITNAGIL_DEV_URL }} BITNAGIL_PROD_URL: ${{ secrets.BITNAGIL_PROD_URL }} + RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }} + RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} + RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }} run: | echo "kakao.native.app.key=$KAKAO_NATIVE_APP_KEY" >> local.properties echo "bitnagil.dev.url=$BITNAGIL_DEV_URL" >> local.properties echo "bitnagil.prod.url=$BITNAGIL_PROD_URL" >> local.properties + echo "release.key.alias=$RELEASE_KEY_ALIAS" >> local.properties + echo "release.key.password=$RELEASE_KEY_PASSWORD" >> local.properties + echo "release.keystore.password=$RELEASE_STORE_PASSWORD" >> local.properties + echo "release.keystore.path=../release.jks" >> local.properties - name: set up JDK 17 uses: actions/setup-java@v4 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index eb2366d8..1bf1f6a0 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -17,6 +17,21 @@ android { } } + signingConfigs { + create("release") { + keyAlias = properties["release.key.alias"] as? String + ?: System.getenv("RELEASE_KEY_ALIAS") + ?: throw GradleException("RELEASE_KEY_ALIAS 값이 없습니다.") + keyPassword = properties["release.key.password"] as? String + ?: System.getenv("RELEASE_KEY_PASSWORD") + ?: throw GradleException("RELEASE_KEY_PASSWORD 값이 없습니다.") + storePassword = properties["release.keystore.password"] as? String + ?: System.getenv("RELEASE_KEYSTORE_PASSWORD") + ?: throw GradleException("RELEASE_KEYSTORE_PASSWORD 값이 없습니다.") + storeFile = File("${properties["release.keystore.path"]}") + } + } + defaultConfig { applicationId = "com.threegap.bitnagil" @@ -51,6 +66,7 @@ android { getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro", ) + signingConfig = signingConfigs.getByName("release") } }