Skip to content

feat: 테스트

feat: 테스트 #377

Workflow file for this run

name: Android CI
on:
push:
branches:
- "develop-AN"
- "feature/414-android-cd"
paths:
- '**'
pull_request:
branches:
- "develop-AN"
paths:
- 'android/**'
defaults:
run:
working-directory: ./android
jobs:
ktlint_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Create google-services
run: echo "${{ secrets.GOOGLE_SERVICES_JSON }}" > ./app/google-services.json
- name: Create local.properties
env:
BASE_URL: ${{ secrets.BASE_URL }}
TOKEN: ${{ secrets.TOKEN }}
NATIVE_APP_KEY: ${{ secrets.NATIVE_APP_KEY }}
run: |
echo "sdk.dir=/Users/chaehyun/Library/Android/sdk" > ./local.properties
echo "base_url=$BASE_URL" >> ./local.properties
echo "token=$TOKEN" >> ./local.properties
echo "native_app_key=$NATIVE_APP_KEY" >> ./local.properties
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Ktlint check
run: ./gradlew ktlintCheck
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Create google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo "$GOOGLE_SERVICES_JSON" > app/google-services.json
- name: Create local.properties
env:
BASE_URL: ${{ secrets.BASE_URL }}
TOKEN: ${{ secrets.TOKEN }}
NATIVE_APP_KEY: ${{ secrets.NATIVE_APP_KEY }}
run: |
echo "sdk.dir=/Users/chaehyun/Library/Android/sdk" > ./local.properties
echo "base_url=$BASE_URL" >> ./local.properties
echo "token=$TOKEN" >> ./local.properties
echo "native_app_key=$NATIVE_APP_KEY" >> ./local.properties
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Gradle Clean check
run: ./gradlew clean
- name: Build with Gradle
run: ./gradlew build
- name: Run Unit Test
run: ./gradlew test
deploy:
runs-on: ubuntu-latest
# needs: build_and_test
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
echo "$GOOGLE_SERVICES_JSON" > app/google-services.json
- name: Set up environment variable for BuildConfig
env:
BASE_URL: ${{ secrets.BASE_URL }}
TOKEN: ${{ secrets.TOKEN }}
NATIVE_APP_KEY: ${{ secrets.NATIVE_APP_KEY }}
run: |
echo "base_url=$BASE_URL" >> ./local.properties
echo "token=$TOKEN" >> ./local.properties
echo "native_app_key=$NATIVE_APP_KEY" >> ./local.properties
- name: Build Release AAB
id: buildRelease
run: ./gradlew bundleRelease
- name: Sign AAB
id: sign
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.KEY_STORE_BASE_64 }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
# - name: Cache Gradle
# uses: actions/cache@v4
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
# - name: Decode keystore
# run: |
# echo "$KEYSTORE" > KEYSTORE_NAME.b64
# base64 -d -i KEYSTORE_NAME.b64 > KEYSTORE_NAME.jks
# env:
# KEYSTORE: ${{ secrets.ENCODED_KEYSTORE }}
- name: Build release AAB
run: ./gradlew bundleRelease
- name: Sign AAB
id: sign

Check failure on line 179 in .github/workflows/android.yml

View workflow run for this annotation

GitHub Actions / Android CI

Invalid workflow file

The workflow is not valid. .github/workflows/android.yml (Line: 179, Col: 13): The identifier 'sign' may not be used more than once within the same scope.
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.ENCODED_KEYSTORE }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Upload AAB to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.zzang.chongdae
releaseFiles: ./android/app/build/outputs/bundle/release/app-release.aab
track: alpha
# status: completed
# inAppUpdatePriority: 2
# userFraction: 0.33
# whatsNewDirectory: distribution/whatsnew
# mappingFile: app/build/outputs/mapping/release/mapping.txt
# debugSymbols: app/intermediates/merged_native_libs/release/out/lib