From 3e03ac054ac6a4149ea59d95db79ce2814207877 Mon Sep 17 00:00:00 2001 From: darkclip Date: Fri, 21 Jul 2023 03:55:26 +0800 Subject: [PATCH] update --- .github/workflows/build-mosdns.yml | 5 +-- .github/workflows/build-sha.yml | 55 ++++++++++++++++++++++++++++++ exp_mosdns.sh | 4 --- 3 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build-sha.yml delete mode 100755 exp_mosdns.sh diff --git a/.github/workflows/build-mosdns.yml b/.github/workflows/build-mosdns.yml index 662bdcd0..cd5d1189 100644 --- a/.github/workflows/build-mosdns.yml +++ b/.github/workflows/build-mosdns.yml @@ -39,14 +39,15 @@ jobs: continue-on-error: true run: rm mosdns/* - name: Rebuild mosdns branch - run: ./exp_mosdns.sh + run: | + ./raydata.py dat-release/geoip.dat -c cn -o mosdns/chinaip.txt geoip + ./raydata.py dat-release/geosite.dat -c cn -o mosdns/chinasite.txt geosite --formatter format_mosdns.json - name: Push to mosdns branch continue-on-error: true run: | cd mosdns tar -cf mosdns.tar *.txt rm *.txt - tree -H . -P "*.txt" -T "MosDNS List - $(date +%Y-%m-%d)" > index.html git config --global user.name "${GITHUB_ACTOR}" git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" git add . diff --git a/.github/workflows/build-sha.yml b/.github/workflows/build-sha.yml new file mode 100644 index 00000000..648ff3ef --- /dev/null +++ b/.github/workflows/build-sha.yml @@ -0,0 +1,55 @@ +name: build sha + +on: + push: + branches: + - 'master' + paths: + - '.github/workflows/**' + schedule: + - cron: '10 16 * * *' + +jobs: + build-sha: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Check out release branch of loyalsoldier/v2ray-rules-dat + uses: actions/checkout@v3 + with: + repository: loyalsoldier/v2ray-rules-dat + ref: release + path: dat-release + - name: Checkout sha branch + uses: actions/checkout@v3 + with: + ref: sha + path: sha + - name: Clean sha branch + continue-on-error: true + run: rm sha/* + - name: Rebuild sha branch + run: | + ./netgen.py ip-lists/china.txt -o net/china.txt -p 'ip route add ' -s $' dev eth0 via 10.11.0.1\n' + ./netgen.py ip-lists/china6.txt -o net/china6.txt -p 'ip route add ' -s $' dev eth0 via fe80::6a77:24ff:fed6:809d\n' + - name: Push to sha branch + continue-on-error: true + run: | + cd sha + tar -cf sha.tar *.txt + rm *.txt + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" + git add . + git commit -m "update $(date +%Y-%m-%d)" + git push -q diff --git a/exp_mosdns.sh b/exp_mosdns.sh deleted file mode 100755 index cc7fd5fe..00000000 --- a/exp_mosdns.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -./raydata.py dat-release/geoip.dat -c cn -o mosdns/chinaip.txt geoip -./raydata.py dat-release/geosite.dat -c cn -o mosdns/chinasite.txt geosite --formatter format_mosdns.json