From 82331c252dd56df40da039f628facb313ccc2002 Mon Sep 17 00:00:00 2001 From: unam Date: Mon, 17 Jun 2024 22:10:26 +0900 Subject: [PATCH] =?UTF-8?q?[add]=20=ED=94=8C=EB=A0=88=EC=9D=B4=EC=8A=A4?= =?UTF-8?q?=ED=86=A0=EC=96=B4=20=EB=B0=B0=ED=8F=AC=20=EC=9E=90=EB=8F=99?= =?UTF-8?q?=ED=99=94=20=ED=8C=8C=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD.yml | 121 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 .github/workflows/CD.yml diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml new file mode 100644 index 000000000..7b544d670 --- /dev/null +++ b/.github/workflows/CD.yml @@ -0,0 +1,121 @@ +name: CD + +on: + push: + branches: [ release ] + +defaults: + run: + shell: bash + working-directory: . + +jobs: + build: + name: Generate APK + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Gradle cache + uses: actions/cache@v2 + 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@v1 + with: + java-version: 17 + + - name: Write compile time google-services.json file + env: + GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} + run: echo $GOOGLE_SERVICES_JSON > app/google-services.json + + - name: Touch local properties + run: touch local.properties + + - name: Access NAVER_CLIENT_ID + env: + NAVER_CLIENT_ID: ${{ secrets.NAVER_CLIENT_ID }} + run: echo "NAVER_CLIENT_ID = \"$NAVER_CLIENT_ID\"" >> local.properties + + - name: Access RUNNECT_NODE_URL + env: + RUNNECT_NODE_URL: ${{ secrets.RUNNECT_NODE_URL }} + run: echo "RUNNECT_NODE_URL=\"$RUNNECT_NODE_URL\"" >> local.properties + + - name: Access RUNNECT_DEV_URL + env: + RUNNECT_DEV_URL: ${{ secrets.RUNNECT_DEV_URL }} + run: echo "RUNNECT_DEV_URL=\"$RUNNECT_DEV_URL\"" >> local.properties + + - name: Access RUNNECT_PROD_URL + env: + RUNNECT_PROD_URL: ${{ secrets.RUNNECT_PROD_URL }} + run: echo "RUNNECT_PROD_URL=\"$RUNNECT_PROD_URL\"" >> local.properties + + - name: Access TMAP_BASE_URL + env: + TMAP_BASE_URL: ${{ secrets.TMAP_BASE_URL }} + run: echo "TMAP_BASE_URL=\"$TMAP_BASE_URL\"" >> local.properties + + - name: Access TMAP_API_KEY + env: + TMAP_API_KEY: ${{ secrets.TMAP_API_KEY }} + run: echo "TMAP_API_KEY=\"$TMAP_API_KEY\"" >> local.properties + + - name: Access GOOGLE_CLIENT_ID + env: + GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} + run: echo "GOOGLE_CLIENT_ID=\"$GOOGLE_CLIENT_ID\"" >> local.properties + + - name: Access REMOTE_KEY_APP_VERSION + env: + REMOTE_KEY_APP_VERSION: ${{ secrets.REMOTE_KEY_APP_VERSION }} + run: echo "REMOTE_KEY_APP_VERSION=\"$REMOTE_KEY_APP_VERSION\"" >> local.properties + + - name: Access KAKAO_CHANNEL_ID + env: + KAKAO_CHANNEL_ID: ${{ secrets.KAKAO_CHANNEL_ID }} + run: echo "KAKAO_CHANNEL_ID=\"$KAKAO_CHANNEL_ID\"" >> local.properties + + - name: Add kakao_strings.xml + env: + KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }} + KAKAO_REDIRECTION_SCHEME: ${{ secrets.KAKAO_REDIRECTION_SCHEME }} + run: | + echo '' > app/src/main/res/values/kakao_strings.xml + echo '' >> app/src/main/res/values/kakao_strings.xml + echo ' $KAKAO_NATIVE_APP_KEY' >> app/src/main/res/values/kakao_strings.xml + echo ' $KAKAO_REDIRECTION_SCHEME' >> app/src/main/res/values/kakao_strings.xml + echo '' >> app/src/main/res/values/kakao_strings.xml + + - name: Decode And Save Keystore Base64 + run: | + echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > app/keystore.jks + + - name: Change gradlew permissions + run: chmod +x ./gradlew + + - name: Build Release AAB + run: ./gradlew bundleRelease --stacktrace + + - name: Save latest commit message as release notes for Korea + run: | + mkdir -p distribution/whatsnew + git log -1 --pretty=format:"%s" > distribution/whatsnew/ko-KR.txt + + - name: Release AAB + uses: r0adkll/upload-google-play@v1 + with: + serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} + packageName: com.runnect.runnect + releaseFiles: app/build/outputs/bundle/release/app-release.aab + track: production + status: inProgress + whatsNewDirectory: 'distribution/whatsnew' \ No newline at end of file