2022-03-17 17:46:04 +08:00
|
|
|
name: bin_update
|
|
|
|
|
|
|
|
on:
|
|
|
|
# release:
|
|
|
|
# types: [published]
|
|
|
|
# push:
|
|
|
|
# tags:
|
|
|
|
# - 'v*'
|
|
|
|
# branches:
|
|
|
|
# - master
|
|
|
|
schedule:
|
2023-04-02 19:39:53 +08:00
|
|
|
- cron: 0 18 * * 6
|
2022-03-17 17:46:04 +08:00
|
|
|
# watch:
|
|
|
|
# types: [started]
|
2022-03-17 17:47:59 +08:00
|
|
|
workflow_dispatch:
|
2022-03-17 17:46:04 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
update:
|
2023-04-02 19:39:53 +08:00
|
|
|
runs-on: ubuntu-latest
|
2022-03-17 17:46:04 +08:00
|
|
|
|
|
|
|
steps:
|
2022-03-17 18:16:48 +08:00
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@master
|
|
|
|
|
2022-03-17 17:46:04 +08:00
|
|
|
- name: Apt Update
|
|
|
|
env:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get -y install unzip curl git tar
|
|
|
|
|
|
|
|
- name: Update Dashboard
|
|
|
|
run: |
|
2023-05-19 15:16:12 +08:00
|
|
|
mkdir -p bin/dashboard
|
|
|
|
mkdir -p bin/geodata
|
2023-05-19 15:12:00 +08:00
|
|
|
cd bin/dashboard
|
2022-03-17 17:46:04 +08:00
|
|
|
echo 下载官方面板
|
2022-05-29 11:42:48 +08:00
|
|
|
curl -kfSL -o clashdb.zip https://github.com/Dreamacro/clash-dashboard/archive/gh-pages.zip
|
|
|
|
echo 下载Meta面板
|
2022-06-21 23:21:30 +08:00
|
|
|
curl -kfSL -o meta_db.zip https://github.com/MetaCubeX/Razord-meta/archive/gh-pages.zip
|
2022-03-17 17:46:04 +08:00
|
|
|
echo 下载yacd面板
|
2022-05-29 11:42:48 +08:00
|
|
|
curl -kfSL -o yacd.zip https://github.com/haishanh/yacd/archive/gh-pages.zip
|
|
|
|
echo 下载meta魔改yacd面板
|
2022-06-21 23:21:30 +08:00
|
|
|
curl -kfSL -o meta_yacd.zip https://github.com/MetaCubeX/Yacd-meta/archive/gh-pages.zip
|
2023-09-17 19:52:39 +08:00
|
|
|
echo 下载meta-xd面板
|
|
|
|
curl -kfSL -o meta_xd.zip https://github.com/MetaCubeX/metacubexd/archive/gh-pages.zip
|
2022-03-17 17:46:04 +08:00
|
|
|
echo 解压缩
|
|
|
|
unzip -o clashdb.zip > /dev/null
|
|
|
|
unzip -o yacd.zip > /dev/null
|
2023-05-19 15:12:00 +08:00
|
|
|
cd clash-dashboard-gh-pages
|
2022-03-17 17:46:04 +08:00
|
|
|
tar -zcvf clashdb.tar.gz * > /dev/null
|
|
|
|
mv -f clashdb.tar.gz ../
|
|
|
|
cd ..
|
2023-05-19 15:12:00 +08:00
|
|
|
cd yacd-gh-pages
|
2022-03-17 17:46:04 +08:00
|
|
|
echo yacd特殊处理
|
|
|
|
find -name '*.map' | xargs rm -rf
|
|
|
|
rm -rf report.html
|
|
|
|
tar -zcvf yacd.tar.gz * > /dev/null
|
|
|
|
mv -f yacd.tar.gz ../
|
|
|
|
cd ..
|
2023-05-19 15:12:00 +08:00
|
|
|
|
2023-09-17 19:52:39 +08:00
|
|
|
echo 解压缩meta
|
2022-05-29 11:42:48 +08:00
|
|
|
unzip -o meta_db.zip > /dev/null
|
|
|
|
unzip -o meta_yacd.zip > /dev/null
|
2023-05-19 15:12:00 +08:00
|
|
|
cd Razord-meta-gh-pages
|
2022-05-29 11:42:48 +08:00
|
|
|
tar -zcvf meta_db.tar.gz * > /dev/null
|
|
|
|
mv -f meta_db.tar.gz ../
|
|
|
|
cd ..
|
2023-05-19 15:12:00 +08:00
|
|
|
cd Yacd-meta-gh-pages
|
2022-05-29 11:42:48 +08:00
|
|
|
echo yacd特殊处理
|
|
|
|
find -name '*.map' | xargs rm -rf
|
|
|
|
rm -rf report.html
|
|
|
|
tar -zcvf meta_yacd.tar.gz * > /dev/null
|
|
|
|
mv -f meta_yacd.tar.gz ../
|
|
|
|
cd ..
|
2023-05-19 15:12:00 +08:00
|
|
|
|
2023-09-17 19:52:39 +08:00
|
|
|
echo 解压缩meta-xd
|
|
|
|
unzip -o meta_xd.zip > /dev/null
|
|
|
|
cd metacubexd-gh-pages
|
|
|
|
echo 删除字体文件
|
|
|
|
find -name '*.ttf' | xargs rm -rf
|
|
|
|
tar -zcvf meta_xd.tar.gz * > /dev/null
|
|
|
|
mv -f meta_xd.tar.gz ../
|
|
|
|
|
|
|
|
cd ..
|
2022-03-17 17:46:04 +08:00
|
|
|
rm -rf clashdb.zip
|
|
|
|
rm -rf yacd.zip
|
2022-05-29 11:42:48 +08:00
|
|
|
rm -rf meta_db.zip
|
|
|
|
rm -rf meta_yacd.zip
|
2023-09-17 19:52:39 +08:00
|
|
|
rm -rf meta_xd.zip
|
2023-05-19 15:12:00 +08:00
|
|
|
rm -rf clash-dashboard-gh-pages
|
|
|
|
rm -rf yacd-gh-pages
|
|
|
|
rm -rf Razord-meta-gh-pages
|
|
|
|
rm -rf Yacd-meta-gh-pages
|
2023-09-17 19:52:39 +08:00
|
|
|
rm -rf metacubexd-gh-pages
|
2022-03-17 19:32:23 +08:00
|
|
|
echo 面板更新完成!
|
|
|
|
|
|
|
|
- name: Update GeoIP
|
|
|
|
run: |
|
2023-05-19 15:12:00 +08:00
|
|
|
cd bin
|
2022-03-17 19:32:23 +08:00
|
|
|
source version
|
2023-05-19 15:12:00 +08:00
|
|
|
curl -kfSL -o geodata/Country.mmdb https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/Country.mmdb
|
|
|
|
curl -kfSL -o geodata/cn_mini.mmdb https://raw.githubusercontent.com/Hackl0us/GeoIP2-CN/release/Country.mmdb
|
|
|
|
curl -kfSL -o geodata/china_ip_list.txt https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt
|
|
|
|
curl -kfSL -o geodata/china_ipv6_list.txt https://raw.githubusercontent.com/ChanthMiao/China-IPv6-List/release/cn6.txt
|
|
|
|
curl -kfSL -o geodata/geosite.dat https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geosite.dat
|
|
|
|
curl -kfSL -o fix/ca-certificates.crt https://raw.githubusercontent.com/P3TERX/ca-certificates.crt/download/ca-certificates.crt
|
2022-03-17 19:32:23 +08:00
|
|
|
sed -i '/GeoIP_v*/'d version
|
2022-03-17 19:40:48 +08:00
|
|
|
echo GeoIP_v=`date '+%Y%m%d'` >> version
|
2023-05-19 15:12:00 +08:00
|
|
|
echo 数据库及根证书文件更新完成!
|
2022-06-02 21:36:10 +08:00
|
|
|
|
2022-03-17 17:46:04 +08:00
|
|
|
- name: Commit and push
|
2022-03-17 18:16:48 +08:00
|
|
|
run: |
|
2022-03-17 17:46:04 +08:00
|
|
|
git config --global user.email "juewuy@gmail.com" && git config --global user.name "Bot"
|
2022-06-02 21:36:10 +08:00
|
|
|
git add . && git commit -m "自动更新最新Dashboard、地址库、根证书" || exit 0
|
2022-03-17 18:16:48 +08:00
|
|
|
git push
|
2022-05-24 12:23:50 +08:00
|
|
|
|
|
|
|
- name: Cleanup Workflow
|
|
|
|
uses: Mattraks/delete-workflow-runs@main
|
|
|
|
with:
|
|
|
|
retain_days: 1
|
2023-04-28 19:59:56 +08:00
|
|
|
keep_minimum_runs: 2
|