-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
100 lines (91 loc) · 2.79 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: github-action-release-apk
description: This is an action to release your apk to github release
author: gogoadl
branding:
icon: 'thumbs-up'
color: 'white'
inputs:
asset-name:
description: 'file name display on releases'
required: false
default: 'app.apk'
github-token:
description: 'token'
required: true
base64-keystore:
description: 'decoded keystore file'
required: false
default: 'true'
key-file:
description: 'key file for signing apk'
required: false
default: 'true'
keystore-password:
description: 'Keytstore password for signing apk'
required: false
default: 'true'
keystore-alias:
description: 'Keystore alias for signing apk'
required: false
default: 'true'
key-password:
description: 'key password for signing apk'
required: false
default: 'true'
runs:
using: 'composite'
steps:
- uses: actions/checkout@v3
- 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
shell: bash
- name: Generate Keystore file from Github Secrets
run: |
echo "${{ inputs.base64-keystore }}" > ./keystore.b64
base64 -d -i ./keystore.b64 > ./${{ inputs.key-file }}
cp ./${{ inputs.key-file }} ./app/${{ inputs.key-file }}
shell: bash
- name: Build Release APK
run: |
bash ./gradlew assembleRelease \
-Pandroid.injected.signing.store.file=${{ inputs.key-file }} \
-Pandroid.injected.signing.store.password=${{ inputs.keystore-password }} \
-Pandroid.injected.signing.key.alias=${{ inputs.keystore-alias }} \
-Pandroid.injected.signing.key.password=${{ inputs.key-password }} \
--stacktrace
shell: bash
- name: Upload artifact Release APK
uses: actions/upload-artifact@v3
with:
name: apk
path: app/build/outputs/apk/release/*.apk
- name: Download APK
uses: actions/download-artifact@v1
with:
name: apk
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release APK
id: upload_release_asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./apk/app-release.apk
asset_name: ${{ inputs.asset-name }}
asset_content_type: application/vnd.android.package-archive