-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (53 loc) · 2.09 KB
/
android-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Android Build
on:
push:
branches: [ develop, master ]
# pull_request:
# branches: [ develop ]
jobs:
apk:
runs-on: ubuntu-latest
# android 디렉토리 없앰으로 인한 주석 처리
# env:
# working-directory: ./android
steps:
# Check Current Branches
- uses: actions/checkout@v2
# JDK 설정
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
# Android SDK 설정
# - name: SetUp Android SDK
# uses: android-actions/setup-android@v2
# Dependency 에 버전 및 릴리즈 메시지 가져오기 working-directory -> 리포지토리 특성상 android 에서 빌드해야 되서 추가함
- name: Release Version
id: release
run: |
echo ::set-output name=code::$(grep versionCode buildSrc/src/main/java/Dependency.kt | awk '{print $5}')
echo ::set-output name=name::$(grep versionName buildSrc/src/main/java/Dependency.kt | awk '{print $5}')
# Tag 명 "" 제거해서 가져오기
- name: Get Version Name
id: version_name
run: echo ::set-output name=val::${{steps.release.outputs.name}}
- name: Get Version Code
id: version_code
run: echo ::set-output name=val::${{steps.release.outputs.code}}
- name: Print version
run: echo "Version ${{steps.version_code.outputs.val}}_${{steps.version_name.outputs.val}}"
# gradlew 권한 획득
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# working-directory: ${{ env.working-directory }}
# Android Build Debug: assembleDebug Release: assembleRelease
- name: Android Build
run: ./gradlew clean assembleDebug
# working-directory: ${{ env.working-directory }}
# Debg Upload Apk
- name: Debug Apk
uses: actions/upload-artifact@v2
with:
name: Generate Debug Apk
path: app/build/outputs/apk/debug/til_${{steps.version_code.outputs.val}}_${{steps.version_name.outputs.val}}-debug.apk