-
-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (77 loc) · 2.66 KB
/
core.yaml
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
name: "Core"
on:
workflow_call:
inputs:
tasklist-filepath:
required: false
type: "string"
is-release:
required: true
type: "boolean"
default: false
jobs:
job-init:
name: "Init"
runs-on: "ubuntu-latest"
outputs:
result: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- id: "set-matrix"
run: |
echo "matrix="`cat ${{ inputs.tasklist-filepath }} `"">> $GITHUB_OUTPUT
job_patch:
needs: job-init
runs-on: "ubuntu-latest"
continue-on-error: true
strategy:
matrix: ${{ fromJSON(needs.job-init.outputs.result) }}
name: "Repacking ${{ matrix.nickname }}"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Setup JDK"
uses: "actions/setup-java@v4"
with:
java-version: "17"
#cache: "gradle"
java-package: "jdk"
distribution: "liberica"
- name: "Download Apk (from WanDouJia)"
if: ${{ matrix.type == 'wandoujia' }}
run: |
# 点我展开
if [[ ${{matrix.data.history_id_num == '' }} ]]; then
url=`curl -I 'https://www.wandoujia.com/apps/${{matrix.data.app_id_num}}/download/dot?ch=detail_normal_dl' \
-H 'authority: www.wandoujia.com' \
-H 'referer: https://www.wandoujia.com/apps/${{matrix.data.app_id_num}}' \
| grep "location:" | sed 's#location: ##'`
else
url=`curl -s "https://www.wandoujia.com/apps/${{matrix.data.app_id_num}}/history_v${{matrix.data.history_id_num}}" \
| grep "data-href" | head -n1 | awk '$1=$1'| sed -e 's/.*href="\(.*\)\" .*/\1/'`
fi
wget -O "temp.apk" $url
- name: "Download Apk (from Direct)"
if: ${{ matrix.type == 'direct' }}
run: |
# 点我展开
aria2c --out "temp.apk" ${{matrix.data.url}}
- name: "Get Apk Info"
id: "apk-info"
uses: "8Mi-Tech/get-apk-info-action@master"
with:
apkPath: "temp.apk"
#版本号:${{steps.apk-info.outputs.versionNum}}
- name: "Patch LSPatch Lib"
run: |
# 点我展开
new_filename="${{ matrix.nickname }}-${{steps.apk-info.outputs.versionNum}}.apk"
cp temp.apk $new_filename
java -jar ./lspatch.jar -v --manager -l 2 -o "output" $new_filename
- name: "Publish to Github Artifact"
uses: "actions/upload-artifact@v4"
with:
name: ${{ matrix.nickname }}-${{steps.apk-info.outputs.versionNum}}
path: output
retention-days: 1