From 80ff1b968b314a3dba9e9f9a095cbd5b1d4042e8 Mon Sep 17 00:00:00 2001 From: darkclip Date: Thu, 20 Jul 2023 21:12:04 +0800 Subject: [PATCH] update --- .github/workflows/build-mosdns.yml | 50 ++++++++++++++++++++++++++++++ exp_mosdns.sh | 4 +++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/build-mosdns.yml create mode 100644 exp_mosdns.sh diff --git a/.github/workflows/build-mosdns.yml b/.github/workflows/build-mosdns.yml new file mode 100644 index 00000000..ea0ebe1c --- /dev/null +++ b/.github/workflows/build-mosdns.yml @@ -0,0 +1,50 @@ +name: build net + +on: + push: + branches: ['*'] + schedule: + - cron: '0 16 * * *' + +jobs: + build-net: + 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 mosdns branch + uses: actions/checkout@v3 + with: + ref: mosdns + path: mosdns + - name: Rebuild mosdns branch + if: github.event_name == 'schedule' + run: | + rm mosdns/* + ./exp_mosdns.sh + - name: Push to mosdns branch + if: github.event_name == 'schedule' + continue-on-error: true + run: | + cd mosdns + 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 . + git commit -m "update $(date +%Y-%m-%d)" + git push -q diff --git a/exp_mosdns.sh b/exp_mosdns.sh new file mode 100644 index 00000000..cc7fd5fe --- /dev/null +++ b/exp_mosdns.sh @@ -0,0 +1,4 @@ +#!/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