diff --git a/.github/workflows/PR_Builder.yml b/.github/workflows/PR_Builder.yml index b84c851b..834a6091 100644 --- a/.github/workflows/PR_Builder.yml +++ b/.github/workflows/PR_Builder.yml @@ -2,7 +2,7 @@ name: Hous PR Builder on: pull_request: - branches: [ develop, main ] + branches: [ develop, master ] jobs: build: @@ -10,65 +10,63 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Gradle cache - uses: actions/cache@v3 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- + - name: Gradle cache + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- - - name: set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 17 + - name: set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 17 -# - name: Create Google-Services.json -# env: -# GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} -# run: | -# touch ./app/google-services.json -# echo $GOOGLE_SERVICES >> ./app/google-services.json -# cat ./app/google-services.json -# - - name: Create Local Properties - run: touch local.properties + # - name: Create Google-Services.json + # env: + # GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} + # run: | + # touch ./app/google-services.json + # echo $GOOGLE_SERVICES >> ./app/google-services.json + # cat ./app/google-services.json + # + - name: Create Local Properties + run: touch local.properties - - name: Access Local Properties - env: - FUNCH_DEBUG_BASE_URL: ${{ secrets.FUNCH_DEBUG_BASE_URL }} -# HOST_RELEASE_URI: ${{ secrets.HOST_RELEASE_URI }} -# KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }} -# KAKAO_REDIRECT_SCHEME: ${{ secrets.KAKAO_REDIRECT_SCHEME }} -# KEYSTORE_PATH: ${{ secrets.KEYSTORE_PATH }} -# STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} -# KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} -# KEY_ALIAS: ${{ secrets.KEY_ALIAS }} -# STORE_FILE: ${{ secrets.STORE_FILE }} - run: | - echo FUNCH_DEBUG_BASE_URL=\"FUNCH_DEBUG_BASE_URL\" >> local.properties -# echo HOST_RELEASE_URI=\"$HOST_RELEASE_URI\" >> local.properties -# echo KAKAO_NATIVE_APP_KEY=\"$KAKAO_NATIVE_APP_KEY\" >> local.properties -# echo KAKAO_REDIRECT_SCHEME=\"$KAKAO_REDIRECT_SCHEME\" >> local.properties -# echo KEYSTORE_PATH= $KEYSTORE_PATH >> local.properties -# echo STORE_PASSWORD= $STORE_PASSWORD >> local.properties -# echo KEY_PASSWORD= $KEY_PASSWORD >> local.properties -# echo KEY_ALIAS= $KEY_ALIAS >> local.properties -# echo STORE_FILE= $STORE_FILE >> local.properties + - name: Access Local Properties + env: + FUNCH_DEBUG_BASE_URL: ${{ secrets.FUNCH_DEBUG_BASE_URL }} + STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + STORE_FILE: ${{ secrets.STORE_FILE }} + run: | + echo FUNCH_DEBUG_BASE_URL=\"FUNCH_DEBUG_BASE_URL\" >> local.properties + echo STORE_PASSWORD= $STORE_PASSWORD >> local.properties + echo KEY_PASSWORD= $KEY_PASSWORD >> local.properties + echo KEY_ALIAS= $KEY_ALIAS >> local.properties + echo STORE_FILE= $STORE_FILE >> local.properties - - name: Grant execute permission for gradlew - run: chmod +x gradlew + - name: Create Key Store + env: + KEY_STORE_BASE_64: ${{secrets.KEY_STORE_BASE_64}} + run: | + echo "$KEY_STORE_BASE_64" | base64 -d > ./funch_key_store.jks - - name: Lint Check - run: ./gradlew ktlintCheck + - name: Grant execute permission for gradlew + run: chmod +x gradlew - - name: run rest - run: ./gradlew test + - name: Lint Check + run: ./gradlew ktlintCheck - - name: Build with Gradle - run: ./gradlew build + - name: run rest + run: ./gradlew test + + - name: Build with Gradle + run: ./gradlew build diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 54efdc68..e691c560 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,6 @@ +import java.io.FileInputStream +import org.jetbrains.kotlin.konan.properties.Properties + plugins { alias(libs.plugins.funch.application) alias(libs.plugins.funch.compose) @@ -19,6 +22,18 @@ android { versionName = libs.versions.appVersion.get() } + signingConfigs { + create("release") { + Properties().apply { + load(FileInputStream(rootProject.file("local.properties"))) + storeFile = rootProject.file(this["STORE_FILE"] as String) + keyAlias = this["KEY_ALIAS"] as String + keyPassword = this["KEY_PASSWORD"] as String + storePassword = this["STORE_PASSWORD"] as String + } + } + } + buildTypes { release { isMinifyEnabled = false @@ -26,6 +41,7 @@ android { getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) + signingConfig = signingConfigs.getByName("release") } } }