-
Notifications
You must be signed in to change notification settings - Fork 128
114 lines (103 loc) · 3.31 KB
/
legado_custom.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: LegadoCustom
on:
workflow_dispatch:
inputs:
git_url:
description: 'Your legado git url'
required: true
default: 'https://github.com/gedoor/legado.git'
git_tag:
description: 'Your legado git tag'
required: true
default: 'master'
app_channel:
description: 'Your legado build channel(App)'
required: true
default: 'App'
app_custom:
description: 'Your legado custom script'
required: true
default: 'diy_10bits.sh'
app_name:
description: 'Legado app name'
required: true
default: '阅读'
app_suffix:
description: 'Legado app suffix'
required: true
default: 'A'
app_launch_name:
description: 'Legado app launch name'
required: true
default: '阅读.A'
webdav_upload:
description: 'Webdav upload when build apk finish'
required: true
default: 'false'
webdav_url:
description: 'Webdav upload url'
required: true
default: 'https://dav.jianguoyun.com/dav/'
webdav_auth:
description: 'Webdav auth user and password'
required: true
default: 'test@test.com:test_12345'
jobs:
build_apk:
if: github.repository_owner == github.actor
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: setup Gradle
uses: gradle/gradle-build-action@v2.4.2
- name: set env
shell: bash
env:
SECRETS_APP_NAME: ${{ github.event.inputs.app_name }}
SECRETS_GIT_URL: ${{ github.event.inputs.git_url }}
SECRETS_CHANNEL: ${{ github.event.inputs.app_channel }}
SECRETS_SUFFIX: ${{ github.event.inputs.app_suffix }}
SECRETS_ENABLE: ${{ secrets.ENABLE }}
SECRETS_MINIFY: ${{ secrets.MINIFY }}
SECRETS_RENAME: ${{ secrets.RENAME }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_ACTOR: ${{ github.actor }}
SECRETS_TAG: ${{ github.event.inputs.git_tag }}
SECRETS_LAUNCH_NAME: ${{ github.event.inputs.app_launch_name }}
run: source $GITHUB_WORKSPACE/action_setenv.sh
- name: clone code
shell: bash
run: source $GITHUB_WORKSPACE/action_clone.sh
- name: custom your app
shell: bash
env:
custom: ${{ github.event.inputs.app_custom }}
run: |
source $GITHUB_WORKSPACE/diy/$custom
- name: build your app
if: success()
shell: bash
run: |
source $GITHUB_WORKSPACE/action_app_build.sh
app_build
- name: upload artifact
uses: actions/upload-artifact@v2
if: success()
with:
name: ${{ env.APP_UPLOAD_NAME }}
path: ${{ env.APP_UPLOAD }}
- name: upload to webdav
if: success()
shell: bash
env:
WEBDAV_URL: ${{ github.event.inputs.webdav_url }}
WEBDAV_AUTH: ${{ github.event.inputs.webdav_auth }}
WEBDAV_UPLOAD: ${{ github.event.inputs.webdav_upload }}
run: |
source $GITHUB_WORKSPACE/action_util.sh
webdav_upload $APP_UPLOAD/*.apk