Skip to content

Fix:TOP-83 문제 수정 테스트를 위해 CD발동 조건에 83번 브랜치 추가 #12

Fix:TOP-83 문제 수정 테스트를 위해 CD발동 조건에 83번 브랜치 추가

Fix:TOP-83 문제 수정 테스트를 위해 CD발동 조건에 83번 브랜치 추가 #12

Workflow file for this run

name: Android CD
on:
push:
branches: [main, qa, fix/TOP-83_patch_location_fail]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Cache Gradle packages
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Access APP_GOOGLE_SERVICES_JSON
run: echo '${{ secrets.APP_GOOGLE_SERVICES_JSON }}' > ./app/google-services.json
- name: Access DATA_GOOGLE_SERVICES_JSON
run: echo '${{ secrets.DATA_GOOGLE_SERVICES_JSON }}' > ./data/google-services.json
- name: Add Key Info into local.properties
run: |
touch ./local.properties
echo -e KAKAO_NATIVE_APP_KEY=\"$KAKAO_NATIVE_APP_KEY\" >> ./local.properties
echo -e NAVER_CLIENT_ID=\"$NAVER_CLIENT_ID\" >> ./local.properties
echo -e NAVER_CLIENT_SECRET=\"$NAVER_CLIENT_SECRET\" >> ./local.properties
echo -e REGION_CODE_SERVICE_KEY=\"$REGION_CODE_SERVICE_KEY\" >> ./local.properties
echo -e APP_EMAIL_ID=\"$APP_EMAIL_ID\" >> ./local.properties
echo -e APP_EMAIL_PASSWORD=\"$APP_EMAIL_PASSWORD\" >> ./local.properties
echo -e CEO_EMAIL=\"$CEO_EMAIL\" >> ./local.properties
cat ./local.properties
env:
KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }}
NAVER_CLIENT_SECRET: ${{ secrets.NAVER_CLIENT_SECRET }}
NAVER_CLIENT_ID: ${{ secrets.NAVER_CLIENT_ID }}
REGION_CODE_SERVICE_KEY: ${{ secrets.REGION_CODE_SERVICE_KEY }}
APP_EMAIL_ID: ${{ secrets.APP_EMAIL_ID }}
APP_EMAIL_PASSWORD: ${{ secrets.APP_EMAIL_PASSWORD }}
CEO_EMAIL: ${{ secrets.CEO_EMAIL }}
- name: Build with Gradle Without Test
run: ./gradlew build -x test
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Access APP_GOOGLE_SERVICES_JSON
run: echo '${{ secrets.APP_GOOGLE_SERVICES_JSON }}' > ./app/google-services.json
- name: Access DATA_GOOGLE_SERVICES_JSON
run: echo '${{ secrets.DATA_GOOGLE_SERVICES_JSON }}' > ./data/google-services.json
- name: Add Key Info into local.properties
run: |
touch ./local.properties
echo -e KAKAO_NATIVE_APP_KEY=\"$KAKAO_NATIVE_APP_KEY\" >> ./local.properties
echo -e NAVER_CLIENT_ID=\"$NAVER_CLIENT_ID\" >> ./local.properties
echo -e NAVER_CLIENT_SECRET=\"$NAVER_CLIENT_SECRET\" >> ./local.properties
echo -e REGION_CODE_SERVICE_KEY=\"$REGION_CODE_SERVICE_KEY\" >> ./local.properties
echo -e APP_EMAIL_ID=\"$APP_EMAIL_ID\" >> ./local.properties
echo -e APP_EMAIL_PASSWORD=\"$APP_EMAIL_PASSWORD\" >> ./local.properties
echo -e CEO_EMAIL=\"$CEO_EMAIL\" >> ./local.properties
cat ./local.properties
env:
KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }}
NAVER_CLIENT_SECRET: ${{ secrets.NAVER_CLIENT_SECRET }}
NAVER_CLIENT_ID: ${{ secrets.NAVER_CLIENT_ID }}
REGION_CODE_SERVICE_KEY: ${{ secrets.REGION_CODE_SERVICE_KEY }}
APP_EMAIL_ID: ${{ secrets.APP_EMAIL_ID }}
APP_EMAIL_PASSWORD: ${{ secrets.APP_EMAIL_PASSWORD }}
CEO_EMAIL: ${{ secrets.CEO_EMAIL }}
- name: Run unit tests
run: ./gradlew testDebugUnitTest
- name: Create android test report
uses: asadmansr/[email protected]
if: ${{ always() }}
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Cache Gradle packages
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Add Key Info into local.properties
run: |
touch ./local.properties
echo -e KAKAO_NATIVE_APP_KEY=\"$KAKAO_NATIVE_APP_KEY\" >> ./local.properties
echo -e NAVER_CLIENT_ID=\"$NAVER_CLIENT_ID\" >> ./local.properties
echo -e NAVER_CLIENT_SECRET=\"$NAVER_CLIENT_SECRET\" >> ./local.properties
echo -e REGION_CODE_SERVICE_KEY=\"$REGION_CODE_SERVICE_KEY\" >> ./local.properties
echo -e APP_EMAIL_ID=\"$APP_EMAIL_ID\" >> ./local.properties
echo -e APP_EMAIL_PASSWORD=\"$APP_EMAIL_PASSWORD\" >> ./local.properties
echo -e CEO_EMAIL=\"$CEO_EMAIL\" >> ./local.properties
cat ./local.properties
env:
KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }}
NAVER_CLIENT_SECRET: ${{ secrets.NAVER_CLIENT_SECRET }}
NAVER_CLIENT_ID: ${{ secrets.NAVER_CLIENT_ID }}
REGION_CODE_SERVICE_KEY: ${{ secrets.REGION_CODE_SERVICE_KEY }}
APP_EMAIL_ID: ${{ secrets.APP_EMAIL_ID }}
APP_EMAIL_PASSWORD: ${{ secrets.APP_EMAIL_PASSWORD }}
CEO_EMAIL: ${{ secrets.CEO_EMAIL }}
- name: Access APP_GOOGLE_SERVICES_JSON
run: echo '${{ secrets.APP_GOOGLE_SERVICES_JSON }}' > ./app/google-services.json
- name: Access DATA_GOOGLE_SERVICES_JSON
run: echo '${{ secrets.DATA_GOOGLE_SERVICES_JSON }}' > ./data/google-services.json
- name: Gradel Release Build
run: ./gradlew assembleRelease
- name: Sign APK
id: sign_apk
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEY_BASE_64_RELEASE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{secrets.FIREBASE_APP_ID}}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: android-developer, tht-team
file: app/build/outputs/apk/release/app-release-unsigned-signed.apk
releaseNotesFile: app/release_note.md
alert:
runs-on: ubuntu-latest
needs: [build, release, test]
steps:
- name: action-slack
uses: 8398a7/[email protected]
with:
status: ${{ job.status }}
author_name: THT-Android CI
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
custom_payload: |
{
attachments: [{
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
text: `${process.env.AS_WORKFLOW}\n${process.env.AS_JOB} (${process.env.AS_COMMIT}) of ${process.env.AS_REPO}@${process.env.AS_REF} by ${process.env.AS_AUTHOR} ${{ job.status }} in ${process.env.AS_TOOK}`,
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
if: always() # Pick up events even if the job fails or is canceled.