-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
71 lines (61 loc) · 1.95 KB
/
action.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
66
67
68
69
70
name: 'Android CI'
description: 'Build, test, and release Android apps'
inputs:
gradle_cmd:
description: 'Gradle command to execute'
required: true
default: 'assembleDebug'
tag:
description: 'Release tag prefix'
required: true
default: 'Release'
body_release:
description: 'Release body'
required: true
default: 'Aplikasi ini otomatis dirilis.'
file_output:
description: 'Path to APK file'
required: true
default: './app/build/outputs/apk/debug/app-debug.apk'
runs:
using: 'composite'
steps:
- name: Setting JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Memberikan Perizinan gradlew
run: chmod +x gradlew
shell: bash
- name: Build APK
run: bash ./gradlew ${{ inputs.gradle_cmd }} --stacktrace
shell: bash
- name: Upload APK to Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}
path: ${{ inputs.file_output }}
- name: Create Release and Upload Asset
id: release-id
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: "${{ inputs.tag }}-${{ github.run_number }}"
release_name: ${{ github.event.repository.name }}
body: ${{ inputs.body_release }}
draft: false
prerelease: false
# Upload asset setelah release dibuat di step yang sama
continue-on-error: true # Lanjutkan jika upload asset gagal
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release-id.outputs.upload_url }}
asset_path: ${{ inputs.file_output }}
asset_name: ${{ github.event.repository.name }}-${{ github.run_number }}.apk
asset_content_type: application/vnd.android.package-archive
continue-on-error: true