定时更新GitHub源插件 #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "定时更新GitHub源插件" | |
| on: | |
| schedule: | |
| - cron: "0 19 * * SUN" | |
| #服务器时间:晚7点,每周日 | |
| #北京时间:凌晨3点,每周一 | |
| jobs: | |
| auto-update: | |
| name: "自动更新GitHub插件" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "执行PHP脚本" | |
| run: | | |
| php AUTO-UPDATE.php ${{ secrets.GITHUB_TOKEN }} | |
| - name: "提交更新文件" | |
| uses: stefanzweifel/git-auto-commit-action@v6 | |
| with: | |
| commit_message: "Cron update github plugins in TESTORE.md & README.md" | |
| - name: "上传操作记录" | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "updates-log" | |
| path: /home/runner/work/plugins/TMP/updates.log | |
| - name: "检测压缩文件" | |
| id: match-zips | |
| run: | | |
| echo A2C=$(find /home/runner/work/plugins/NEW -type f -name "[a-cA-C]*") >> $GITHUB_OUTPUT | |
| echo D2G=$(find /home/runner/work/plugins/NEW -type f -name "[d-gD-G]*") >> $GITHUB_OUTPUT | |
| echo H2L=$(find /home/runner/work/plugins/NEW -type f -name "[h-lH-L]*") >> $GITHUB_OUTPUT | |
| echo M2R=$(find /home/runner/work/plugins/NEW -type f -name "[m-rM-R]*") >> $GITHUB_OUTPUT | |
| echo S2Z=$(find /home/runner/work/plugins/NEW -type f -name "[s-zS-Z]*") >> $GITHUB_OUTPUT | |
| - name: "发布压缩包A-C" | |
| uses: svenstaro/upload-release-action@v2 | |
| if: steps.match-zips.outputs.A2C | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: /home/runner/work/plugins/NEW/[a-cA-C]* | |
| tag: "plugins-A_to_C" | |
| overwrite: true | |
| file_glob: true | |
| - name: "发布压缩包D-G" | |
| uses: svenstaro/upload-release-action@v2 | |
| if: steps.match-zips.outputs.D2G | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: /home/runner/work/plugins/NEW/[d-gD-G]* | |
| tag: "plugins-D_to_G" | |
| overwrite: true | |
| file_glob: true | |
| - name: "发布压缩包H-L" | |
| uses: svenstaro/upload-release-action@v2 | |
| if: steps.match-zips.outputs.H2L | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: /home/runner/work/plugins/NEW/[h-lH-L]* | |
| tag: "plugins-H_to_L" | |
| overwrite: true | |
| file_glob: true | |
| - name: "发布压缩包M-R" | |
| uses: svenstaro/upload-release-action@v2 | |
| if: steps.match-zips.outputs.M2R | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: /home/runner/work/plugins/NEW/[m-rM-R]* | |
| tag: "plugins-M_to_R" | |
| overwrite: true | |
| file_glob: true | |
| - name: "发布压缩包S-Z" | |
| uses: svenstaro/upload-release-action@v2 | |
| if: steps.match-zips.outputs.S2Z | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: /home/runner/work/plugins/NEW/[s-zS-Z]* | |
| tag: "plugins-S_to_Z" | |
| overwrite: true | |
| file_glob: true |