From 62dd05536c6f181a53477d4506acb3fed3e7148e Mon Sep 17 00:00:00 2001 From: darkclip Date: Fri, 1 Nov 2024 20:52:02 +0800 Subject: [PATCH] delete sha --- .github/workflows/build-sha.yml | 100 -------------------- {mosdns => example-mosdns}/build-mosdns.yml | 15 +-- {mosdns => example-mosdns}/config.yml | 0 {mosdns => example-mosdns}/format.json | 0 4 files changed, 8 insertions(+), 107 deletions(-) delete mode 100644 .github/workflows/build-sha.yml rename {mosdns => example-mosdns}/build-mosdns.yml (88%) rename {mosdns => example-mosdns}/config.yml (100%) rename {mosdns => example-mosdns}/format.json (100%) diff --git a/.github/workflows/build-sha.yml b/.github/workflows/build-sha.yml deleted file mode 100644 index 73828a3e..00000000 --- a/.github/workflows/build-sha.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: build-sha - -on: - push: - branches: - - "master" - paths: - - ".github/workflows/build-sha.yml" - workflow_dispatch: - -jobs: - build-sha: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - 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: Checkout reference branch 1 - uses: actions/checkout@v4 - with: - ref: net - path: ref1 - - name: Checkout target branch - uses: actions/checkout@v4 - with: - ref: sha - path: target - - name: Clean target branch - continue-on-error: true - run: rm target/* - - name: Rebuild target branch - run: | - WARP_DEV="wgcf" - GW_DEV="eth0" - GW_V4="10.11.0.1" - GW_V6="fe80::6a77:24ff:fed6:809d" - UP_SCRIPT="wgcf-up.sh" - DOWN_SCRIPT="wgcf-down.sh" - echo "iptables -t nat -A POSTROUTING -o $WARP_DEV -j MASQUERADE || true" >> target/$UP_SCRIPT - echo "ip6tables -t nat -A POSTROUTING -o $WARP_DEV -j MASQUERADE || true" >> target/$UP_SCRIPT - echo "iptables -t nat -A POSTROUTING -o $GW_DEV -j MASQUERADE || true" >> target/$UP_SCRIPT - echo "ip6tables -t nat -A POSTROUTING -o $GW_DEV -j MASQUERADE || true" >> target/$UP_SCRIPT - echo "ip route add 162.159.192.0/24 dev $GW_DEV via $GW_V4 || true" >> target/$UP_SCRIPT - echo "ip route add 162.159.193.0/24 dev $GW_DEV via $GW_V4 || true" >> target/$UP_SCRIPT - echo "ip route add 162.159.195.0/24 dev $GW_DEV via $GW_V4 || true" >> target/$UP_SCRIPT - echo "ip route add 162.159.204.0/24 dev $GW_DEV via $GW_V4 || true" >> target/$UP_SCRIPT - echo "ip route add 188.114.96.0/22 dev $GW_DEV via $GW_V4 || true" >> target/$UP_SCRIPT - echo "ip route add 2606:4700:d0::/47 dev $GW_DEV via $GW_V6 || true" >> target/$UP_SCRIPT - ./netgen.py ref1/china4.txt -o target/$UP_SCRIPT -p "ip route add " -s " dev $GW_DEV via $GW_V4 || true" - ./netgen.py ref1/china6.txt -o target/$UP_SCRIPT -p "ip route add " -s " dev $GW_DEV via $GW_V6 || true" - ./netgen.py private4.txt -o target/$UP_SCRIPT -p "ip route add " -s " dev $GW_DEV via $GW_V4 || true" - ./netgen.py private6.txt -o target/$UP_SCRIPT -p "ip route add " -s " dev $GW_DEV via $GW_V6 || true" - echo "ip route add 1.1.1.1/32 dev $WARP_DEV || true" >> target/$UP_SCRIPT - echo "ip route add 2606:4700:4700::1111/128 dev $WARP_DEV || true" >> target/$UP_SCRIPT - echo "ip route add 0.0.0.0/1 dev $WARP_DEV || true" >> target/$UP_SCRIPT - echo "ip route add 128.0.0.0/1 dev $WARP_DEV || true" >> target/$UP_SCRIPT - echo "ip route add ::/1 dev $WARP_DEV || true" >> target/$UP_SCRIPT - echo "ip route add 8000::/1 dev $WARP_DEV || true" >> target/$UP_SCRIPT - echo "iptables -t nat -D POSTROUTING -o $WARP_DEV -j MASQUERADE || true" >> target/$DOWN_SCRIPT - echo "ip6tables -t nat -D POSTROUTING -o $WARP_DEV -j MASQUERADE || true" >> target/$DOWN_SCRIPT - echo "iptables -t nat -D POSTROUTING -o $GW_DEV -j MASQUERADE || true" >> target/$DOWN_SCRIPT - echo "ip6tables -t nat -D POSTROUTING -o $GW_DEV -j MASQUERADE || true" >> target/$DOWN_SCRIPT - echo "ip route del 162.159.192.0/24 dev $GW_DEV via $GW_V4 || true" >> target/$DOWN_SCRIPT - echo "ip route del 162.159.193.0/24 dev $GW_DEV via $GW_V4 || true" >> target/$DOWN_SCRIPT - echo "ip route del 162.159.195.0/24 dev $GW_DEV via $GW_V4 || true" >> target/$DOWN_SCRIPT - echo "ip route del 162.159.204.0/24 dev $GW_DEV via $GW_V4 || true" >> target/$DOWN_SCRIPT - echo "ip route del 188.114.96.0/22 dev $GW_DEV via $GW_V4 || true" >> target/$DOWN_SCRIPT - echo "ip route del 2606:4700:d0::/47 dev $GW_DEV via $GW_V6 || true" >> target/$DOWN_SCRIPT - ./netgen.py ref1/china4.txt -o target/$DOWN_SCRIPT -p "ip route del " -s " dev $GW_DEV via $GW_V4 || true" - ./netgen.py ref1/china6.txt -o target/$DOWN_SCRIPT -p "ip route del " -s " dev $GW_DEV via $GW_V6 || true" - ./netgen.py private4.txt -o target/$DOWN_SCRIPT -p "ip route del " -s " dev $GW_DEV via $GW_V4 || true" - ./netgen.py private6.txt -o target/$DOWN_SCRIPT -p "ip route del " -s " dev $GW_DEV via $GW_V6 || true" - echo "ip route del 1.1.1.1/32 dev $WARP_DEV || true" >> target/$DOWN_SCRIPT - echo "ip route del 2606:4700:4700::1111/128 dev $WARP_DEV || true" >> target/$DOWN_SCRIPT - echo "ip route del 0.0.0.0/1 dev $WARP_DEV || true" >> target/$DOWN_SCRIPT - echo "ip route del 128.0.0.0/1 dev $WARP_DEV || true" >> target/$DOWN_SCRIPT - echo "ip route del ::/1 dev $WARP_DEV || true" >> target/$DOWN_SCRIPT - echo "ip route del 8000::/1 dev $WARP_DEV || true" >> target/$DOWN_SCRIPT - cp wg-watch.sh target/ - cd target - chmod +x *.sh - tar -cf warp.tar *.sh - rm *.sh - - name: Push to target branch - continue-on-error: true - run: | - cd target - 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/mosdns/build-mosdns.yml b/example-mosdns/build-mosdns.yml similarity index 88% rename from mosdns/build-mosdns.yml rename to example-mosdns/build-mosdns.yml index 3230c450..af7b4701 100644 --- a/mosdns/build-mosdns.yml +++ b/example-mosdns/build-mosdns.yml @@ -3,11 +3,12 @@ name: build-mosdns on: push: branches: - - 'master' + - "master" paths: - - '.github/workflows/build-mosdns.yml' + - ".github/workflows/build-mosdns.yml" + workflow_dispatch: schedule: - - cron: '0 16 * * *' + - cron: "0 16 * * *" jobs: build-mosdns: @@ -15,23 +16,23 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.10' + 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: Checkout reference branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: loyalsoldier/v2ray-rules-dat ref: release path: ref - name: Checkout target branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: mosdns path: target diff --git a/mosdns/config.yml b/example-mosdns/config.yml similarity index 100% rename from mosdns/config.yml rename to example-mosdns/config.yml diff --git a/mosdns/format.json b/example-mosdns/format.json similarity index 100% rename from mosdns/format.json rename to example-mosdns/format.json