fix : 빌드 오류 수정 #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*.*.*' | |
pull_request: | |
branches: | |
- main | |
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: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Set output | |
id: vars | |
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: Check output | |
env: | |
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | |
run: | | |
echo $RELEASE_VERSION | |
echo ${{ steps.vars.outputs.tag }} | |
- name: Bump version | |
uses: chkfung/android-version-actions@v1.2.1 | |
with: | |
gradlePath: app/build.gradle # or app/build.gradle.kts | |
versionCode: ${{github.run_number}} | |
versionName: ${{env.RELEASE_VERSION}} | |
- name: Build Debug APK | |
run: ./gradlew assembleDebug | |
- name: Upload artifact Debug APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: apk | |
path: app/build/outputs/apk/debug/*.apk | |
release: | |
permissions: | |
contents: write | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 # Necessary to access local action | |
- name: github-action-release-apk | |
uses: gogoadl/github-action-release-apk@v1.0.0-alpha09 | |
with: | |
asset-name: 'Cocktails.apk' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
base64-keystore: ${{ secrets.APP_KEYSTORE_BASE64 }} | |
key-file: ${{ secrets.APP_KEY_FILE }} | |
keystore-password: ${{ secrets.APP_KEYSTORE_PASSWORD }} | |
keystore-alias: ${{ secrets.APP_KEYSTORE_ALIAS }} | |
key-password: ${{ secrets.APP_KEY_PASSWORD }} |