Skip to content

Commit 7125c94

Browse files
committed
Github Actions工作流yml配置文件和PHP脚本上新,配合将来新版TeStore整修目录数据
1 parent f7b5fc8 commit 7125c94

File tree

8 files changed

+1040
-700
lines changed

8 files changed

+1040
-700
lines changed

.github/workflows/diff-download.yml

Lines changed: 0 additions & 129 deletions
This file was deleted.

.github/workflows/diff-on-push.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
2+
name: "推送检测改动表格条目"
3+
4+
on:
5+
push:
6+
branches:
7+
- "master"
8+
9+
jobs:
10+
11+
diff-update:
12+
name: "更新有变动的插件zip"
13+
runs-on: "ubuntu-latest"
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: "生成实时diff"
21+
id: match-diff
22+
run: |
23+
mkdir -p /home/runner/work/plugins/TMP
24+
diff=$(git diff HEAD^ HEAD)
25+
if echo "$diff" | tee /home/runner/work/plugins/TMP/latest.diff | grep -qE "^\+\+\+ b/(TESTORE\.md|README_test\.md)"
26+
then
27+
echo md=1 >> $GITHUB_OUTPUT
28+
else
29+
echo md= >> $GITHUB_OUTPUT
30+
fi
31+
32+
- name: "执行PHP脚本"
33+
if: steps.match-diff.outputs.md
34+
run: |
35+
php AUTO-UPDATE.php ${{ secrets.GITHUB_TOKEN }} /home/runner/work/plugins/TMP/latest.diff
36+
37+
- name: "提交更新文件"
38+
uses: stefanzweifel/git-auto-commit-action@v6
39+
if: steps.match-diff.outputs.md
40+
with:
41+
commit_message: "Auto update altered plugins in TESTORE.md & README.md"
42+
43+
- name: "上传操作记录"
44+
uses: actions/upload-artifact@v4
45+
if: steps.match-diff.outputs.md
46+
with:
47+
name: "updates-log"
48+
path: /home/runner/work/plugins/TMP/updates.log
49+
50+
- name: "检测压缩文件"
51+
id: match-zips
52+
if: steps.match-diff.outputs.md
53+
run: |
54+
echo A2C=$(find /home/runner/work/plugins/NEW -type f -name "[a-cA-C]*") >> $GITHUB_OUTPUT
55+
echo D2G=$(find /home/runner/work/plugins/NEW -type f -name "[d-gD-G]*") >> $GITHUB_OUTPUT
56+
echo H2L=$(find /home/runner/work/plugins/NEW -type f -name "[h-lH-L]*") >> $GITHUB_OUTPUT
57+
echo M2R=$(find /home/runner/work/plugins/NEW -type f -name "[m-rM-R]*") >> $GITHUB_OUTPUT
58+
echo S2Z=$(find /home/runner/work/plugins/NEW -type f -name "[s-zS-Z]*") >> $GITHUB_OUTPUT
59+
60+
- name: "发布压缩包A-C"
61+
uses: svenstaro/upload-release-action@v2
62+
if: steps.match-zips.outputs.A2C
63+
with:
64+
repo_token: ${{ secrets.GITHUB_TOKEN }}
65+
file: /home/runner/work/plugins/NEW/[a-cA-C]*
66+
tag: "plugins-A_to_C"
67+
overwrite: true
68+
file_glob: true
69+
70+
- name: "发布压缩包D-G"
71+
uses: svenstaro/upload-release-action@v2
72+
if: steps.match-zips.outputs.D2G
73+
with:
74+
repo_token: ${{ secrets.GITHUB_TOKEN }}
75+
file: /home/runner/work/plugins/NEW/[d-gD-G]*
76+
tag: "plugins-D_to_G"
77+
overwrite: true
78+
file_glob: true
79+
80+
- name: "发布压缩包H-L"
81+
uses: svenstaro/upload-release-action@v2
82+
if: steps.match-zips.outputs.H2L
83+
with:
84+
repo_token: ${{ secrets.GITHUB_TOKEN }}
85+
file: /home/runner/work/plugins/NEW/[h-lH-L]*
86+
tag: "plugins-H_to_L"
87+
overwrite: true
88+
file_glob: true
89+
90+
- name: "发布压缩包M-R"
91+
uses: svenstaro/upload-release-action@v2
92+
if: steps.match-zips.outputs.M2R
93+
with:
94+
repo_token: ${{ secrets.GITHUB_TOKEN }}
95+
file: /home/runner/work/plugins/NEW/[m-rM-R]*
96+
tag: "plugins-M_to_R"
97+
overwrite: true
98+
file_glob: true
99+
100+
- name: "发布压缩包S-Z"
101+
uses: svenstaro/upload-release-action@v2
102+
if: steps.match-zips.outputs.S2Z
103+
with:
104+
repo_token: ${{ secrets.GITHUB_TOKEN }}
105+
file: /home/runner/work/plugins/NEW/[s-zS-Z]*
106+
tag: "plugins-S_to_Z"
107+
overwrite: true
108+
file_glob: true

.github/workflows/all-scheduled.yml renamed to .github/workflows/gh-scheduled.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# 自动检测所有已登记GitHub插件版本并同步更新zip
21

3-
name: "定时更新全GitHub插件"
2+
name: "定时更新GitHub源插件"
43

54
on:
65
schedule:
@@ -22,9 +21,9 @@ jobs:
2221
php AUTO-UPDATE.php ${{ secrets.GITHUB_TOKEN }}
2322
2423
- name: "提交更新文件"
25-
uses: stefanzweifel/git-auto-commit-action@v4
24+
uses: stefanzweifel/git-auto-commit-action@v6
2625
with:
27-
commit_message: "Auto update GitHub plugins in TESTORE.md"
26+
commit_message: "Cron update github plugins in TESTORE.md & README.md"
2827

2928
- name: "上传操作记录"
3029
uses: actions/upload-artifact@v4
@@ -35,23 +34,18 @@ jobs:
3534
- name: "检测压缩文件"
3635
id: match-zips
3736
run: |
38-
a2c=`find /home/runner/work/plugins/TMP/NEW -type f -name "[a-cA-C]*"`
39-
echo "::set-output name=A2C::$a2c"
40-
d2g=`find /home/runner/work/plugins/TMP/NEW -type f -name "[d-gD-G]*"`
41-
echo "::set-output name=D2G::$d2g"
42-
h2l=`find /home/runner/work/plugins/TMP/NEW -type f -name "[h-lH-L]*"`
43-
echo "::set-output name=H2L::$h2l"
44-
m2r=`find /home/runner/work/plugins/TMP/NEW -type f -name "[m-rM-R]*"`
45-
echo "::set-output name=M2R::$m2r"
46-
s2z=`find /home/runner/work/plugins/TMP/NEW -type f -name "[s-zS-Z]*"`
47-
echo "::set-output name=S2Z::$s2z"
37+
echo A2C=$(find /home/runner/work/plugins/NEW -type f -name "[a-cA-C]*") >> $GITHUB_OUTPUT
38+
echo D2G=$(find /home/runner/work/plugins/NEW -type f -name "[d-gD-G]*") >> $GITHUB_OUTPUT
39+
echo H2L=$(find /home/runner/work/plugins/NEW -type f -name "[h-lH-L]*") >> $GITHUB_OUTPUT
40+
echo M2R=$(find /home/runner/work/plugins/NEW -type f -name "[m-rM-R]*") >> $GITHUB_OUTPUT
41+
echo S2Z=$(find /home/runner/work/plugins/NEW -type f -name "[s-zS-Z]*") >> $GITHUB_OUTPUT
4842
4943
- name: "发布压缩包A-C"
5044
uses: svenstaro/upload-release-action@v2
5145
if: steps.match-zips.outputs.A2C
5246
with:
5347
repo_token: ${{ secrets.GITHUB_TOKEN }}
54-
file: /home/runner/work/plugins/TMP/NEW/[a-cA-C]*
48+
file: /home/runner/work/plugins/NEW/[a-cA-C]*
5549
tag: "plugins-A_to_C"
5650
overwrite: true
5751
file_glob: true
@@ -61,7 +55,7 @@ jobs:
6155
if: steps.match-zips.outputs.D2G
6256
with:
6357
repo_token: ${{ secrets.GITHUB_TOKEN }}
64-
file: /home/runner/work/plugins/TMP/NEW/[d-gD-G]*
58+
file: /home/runner/work/plugins/NEW/[d-gD-G]*
6559
tag: "plugins-D_to_G"
6660
overwrite: true
6761
file_glob: true
@@ -71,7 +65,7 @@ jobs:
7165
if: steps.match-zips.outputs.H2L
7266
with:
7367
repo_token: ${{ secrets.GITHUB_TOKEN }}
74-
file: /home/runner/work/plugins/TMP/NEW/[h-lH-L]*
68+
file: /home/runner/work/plugins/NEW/[h-lH-L]*
7569
tag: "plugins-H_to_L"
7670
overwrite: true
7771
file_glob: true
@@ -81,7 +75,7 @@ jobs:
8175
if: steps.match-zips.outputs.M2R
8276
with:
8377
repo_token: ${{ secrets.GITHUB_TOKEN }}
84-
file: /home/runner/work/plugins/TMP/NEW/[m-rM-R]*
78+
file: /home/runner/work/plugins/NEW/[m-rM-R]*
8579
tag: "plugins-M_to_R"
8680
overwrite: true
8781
file_glob: true
@@ -91,7 +85,7 @@ jobs:
9185
if: steps.match-zips.outputs.S2Z
9286
with:
9387
repo_token: ${{ secrets.GITHUB_TOKEN }}
94-
file: /home/runner/work/plugins/TMP/NEW/[s-zS-Z]*
88+
file: /home/runner/work/plugins/NEW/[s-zS-Z]*
9589
tag: "plugins-S_to_Z"
9690
overwrite: true
9791
file_glob: true

0 commit comments

Comments
 (0)