Skip to content

Commit

Permalink
Released on 202303011959
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Mar 1, 2023
0 parents commit 05bdb3f
Show file tree
Hide file tree
Showing 19 changed files with 334,219 additions and 0 deletions.
145 changes: 145 additions & 0 deletions .github/workflows/adblock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: Build adblock rules files
on:
schedule:
- cron: 0 */6 * * *
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Setup Go 1.x
uses: actions/setup-go@v3
with:
go-version: "^1.14"

- name: Set $GOPATH and more variables
run: |
echo "RELEASE_NAME=Released on $(date -d "8 hour" -u +%Y%m%d%H%M)" >> $GITHUB_ENV
echo "TAG_NAME=$(date -d "8 hour" -u +%Y%m%d%H%M)" >> $GITHUB_ENV
echo "MODIFIED_TIME=$(date -d "8 hour" -u "+%Y年%m月%d日 %H:%M")" >> $GITHUB_ENV
echo "EASYLIST_URL=https://easylist-downloads.adblockplus.org/easylist.txt" >> $GITHUB_ENV
echo "EASYLISTCHINA_URL=https://easylist-downloads.adblockplus.org/easylistchina.txt" >> $GITHUB_ENV
echo "EASYPRIVACY_URL=https://easylist-downloads.adblockplus.org/easyprivacy.txt" >> $GITHUB_ENV
echo "CJXLIST_URL=https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjxlist.txt" >> $GITHUB_ENV
echo "CJX_ANNOYANCE_URL=https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt" >> $GITHUB_ENV
echo "ANTI_ADBLOCK_KILLER_FILTERS_URL=https://raw.githubusercontent.com/reek/anti-adblock-killer/master/anti-adblock-killer-filters.txt" >> $GITHUB_ENV
echo "ANTIADBLOCKFILTERS_URL=https://easylist-downloads.adblockplus.org/antiadblockfilters.txt" >> $GITHUB_ENV
echo "ABP_FILTERS_ANTI_CV_URL=https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt" >> $GITHUB_ENV
echo "XINGGSF_MV_URL=https://raw.githubusercontent.com/xinggsf/Adblock-Plus-Rule/master/mv.txt" >> $GITHUB_ENV
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV
echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH
shell: bash

- name: Initialize Git
run: |
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
git config --global user.name github-actions[bot]
- name: Checkout the "master" branch
uses: actions/checkout@v3
with:
ref: master

- name: Get every files
id: download
run: |
mkdir -p ./download/
cd ./download
curl -sSL $EASYLIST_URL | sed -e '/^! /d' -e '1c ! EasyList' -e '/^!$/d' -e '/The End/d' -e '/^$/d' > ./easylist.txt
curl -sSL $EASYLISTCHINA_URL | sed -e '/^! /d' -e '1c ! EasyList China' -e '/^!$/d' -e '/The End/d' -e '/^$/d' > ./easylistchina.txt
curl -sSL $EASYPRIVACY_URL | sed -e '/^! /d' -e '1c ! EasyPrivacy' -e '/^!$/d' > ./easyprivacy.txt
curl -sSL $CJXLIST_URL | sed -e '/^! /d' -e '1c ! EasyList Lite' -e '/^!$/d' -e '/The End/d' -e '/^$/d' > ./cjxlist.txt
curl -sSL $CJX_ANNOYANCE_URL | sed -e '/^! /d' -e "1c ! CJX's Annoyance List" -e '/^!$/d' -e '/The End/d' -e '/^$/d' | sed '/热门话题/,+1d' > ./cjx-annoyance.txt
sed -i '/!#include cjx-ublock.txt/c !#include https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-ublock.txt' ./cjx-annoyance.txt
curl -sSL $XINGGSF_MV_URL | sed '/禁止站内新开窗/,+2d' | sed -e '/^! /d' -e '1c ! 乘风 视频广告过滤规则' -e '/^!$/d' -e '/^$/d' > ./xinggsf-mv.txt
curl -sSL $ANTIADBLOCKFILTERS_URL | sed -e '1c ! Adblock Warning Removal List' -e '/^! Checksum/,/! Please check our guidelines/d' -e '/^!$/d' -e '/The End/d' -e '/^$/d' > ./antiadblockfilters.txt
curl -sSL $ABP_FILTERS_ANTI_CV_URL | sed -e '1c ! abp-filters-anti-cv' -e '/^! Checksum/,/adblockplus.org/d' -e '/^!$/d' -e '/The End/d' -e '/^$/d' > ./abp-filters-anti-cv.txt
curl -sSL $ANTI_ADBLOCK_KILLER_FILTERS_URL | sed -e '1c ! AakList (Anti-Adblock Killer)' -e '/^! Title/,/^! RegExpVisualizer/d' -e '/^!$/d' -e '/The End/d' -e '/^$/d' > ./anti-adblock-killer-filters.txt
for i in $(ls *.txt); do
if [[ `cat $i |wc -l` -eq 0 ]]; then
echo "status=failed">> $GITHUB_OUTPUT
break
else
echo "status=success">> $GITHUB_OUTPUT
echo "" >> $i
fi
done
- name: Generate adblock files
if: steps.download.outputs.status == 'success'
run: |
mkdir -p ./new/
cd ./download
cat ../mod/GeneralBlock.txt ../mod/TiebaBlock.txt easylist.txt easylistchina.txt easyprivacy.txt cjx-annoyance.txt xinggsf-mv.txt > ../new/ad-pc.txt
cat ../mod/GeneralBlock.txt easylist.txt easylistchina.txt easyprivacy.txt cjx-annoyance.txt > ../new/ad-mo.txt
cat ../mod/GeneralBlock.txt ../mod/TiebaBlock.txt xinggsf-mv.txt easylistchina.txt cjxlist.txt cjx-annoyance.txt > ../new/ad.txt
cat xinggsf-mv.txt easylistchina.txt cjxlist.txt cjx-annoyance.txt > ../new/ad2.txt
cat xinggsf-mv.txt easylistchina.txt cjxlist.txt cjx-annoyance.txt easyprivacy.txt > ../new/ad3.txt
cat antiadblockfilters.txt abp-filters-anti-cv.txt anti-adblock-killer-filters.txt > ../new/ad-edentw.txt
for i in $(ls ../new/*.txt); do
sed -i '/^$/d' $i
done
- name: Diff and addChecksum
id: diffResult
if: steps.download.outputs.status == 'success'
run: |
mkdir -p ./old_no_title/
chmod +x ./mod/addChecksum.pl
for i in $(ls ad*.txt); do
sed '1,/^!$/d' $i > ./old_no_title/$i
done
diffFile="$(diff -q new/ old_no_title/ |grep -o '[a-zA-Z0-9-]\+.txt' |sort -u)"
if [ -n "$diffFile" ]; then
for i in $diffFile ; do
titleName=$(echo "$i" |sed 's#.txt#-title.txt#')
cat ./mod/$titleName ./new/$i > ./$i
sed -i -e "s#201412030951#$TAG_NAME#" -e "s#201412030952#$MODIFIED_TIME#" ./$i
perl ./mod/addChecksum.pl ./$i
echo "status=success">> $GITHUB_OUTPUT
done
else
echo "status=failed">> $GITHUB_OUTPUT
fi
- name: Deliver download Dir
uses: actions/upload-artifact@v3
if: steps.download.outputs.status == 'failed'
with:
name: AllFiles
path: |
./download/
- name: Deliver new and old_no_title Di
uses: actions/upload-artifact@v3
if: steps.diffResult.outputs.status == 'failed'
with:
name: AllFiles
path: |
*
!./.git/
- name: Git push assets to github & coding
if: steps.diffResult.outputs.status == 'success'
run: |
rm -rf .git/ download/ new/ old_no_title/
git init
git checkout -b master
git add --all
git commit -m "${{ env.RELEASE_NAME }}"
git remote add origin "https://${{ github.actor }}:${{ secrets.WORKFLOW_TOKEN }}@github.com/${{ github.repository }}"
#git remote set-url --add origin "https://${{ secrets.CODING_ACCOUNT }}:${{ secrets.CODING_PASSWORD }}@e.coding.net/${{ secrets.CODING_NAME }}/list.git"
git push -u -f origin master
- name: Release and Upload Assets
if: steps.diffResult.outputs.status == 'success'
uses: ncipollo/release-action@v1
with:
name: ${{ env.RELEASE_NAME }}
tag: adblock
allowUpdates: true
removeArtifacts: true
artifacts: |
*.txt
42 changes: 42 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
46 changes: 46 additions & 0 deletions .github/workflows/smartdns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Smartdns Rules
on:
schedule:
- cron: 0 20 * * *
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set Variables
run: |
echo "RELEASE_NAME=Released on $(date -d "8 hour" -u +%Y%m%d%H%M)" >> $GITHUB_ENV
echo "anti_ad_domains=https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt" >> $GITHUB_ENV
echo "anti_ad_domains_whitelist=https://raw.githubusercontent.com/privacy-protection-tools/dead-horse/master/anti-ad-white-list.txt" >> $GITHUB_ENV
echo "direct_list=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/direct-list.txt" >> $GITHUB_ENV
echo "gfw_list=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/gfw.txt" >> $GITHUB_ENV
echo "greatfire_list=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/greatfire.txt" >> $GITHUB_ENV
- name: Get every files
run: |
curl -sSL $anti_ad_domains |sed '/^#/d' > anti_ad_domains.txt
curl -sSL $anti_ad_domains_whitelist |sed '/^#/d' > anti_ad_domains_whitelist.txt
curl -sSL $direct_list |sed -e '/^#/d' -e '/^regexp:/d' -e 's#^full:##' > direct_list.txt
curl -sSL $gfw_list |sed '/^#/d' > gfw_list.txt
curl -sSL $greatfire_list |sed '/^#/d' > greatfire_list.txt
cat gfw_list.txt greatfire_list.txt |sort -u > gfw.txt
rm -f gfw_list.txt greatfire_list.txt
- name: Generate sha256sum
run: |
for i in $(ls *.txt); do
sha256sum $i > $i.sha256sum
done
- name: Release and Upload Assets
uses: ncipollo/release-action@v1
with:
name: ${{ env.RELEASE_NAME }}
tag: smartdns
allowUpdates: true
removeArtifacts: true
artifacts: |
*.txt
*.txt.sha256sum
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## ABP/ublock订阅规则
1. ad-pc.txt:[推荐桌面端]合并自乘风视频广告过滤规则、Easylist、EasylistChina、EasyPrivacy、CJX'sAnnoyance,以及补充的一些规则;
1. ad-mo.txt:合并自Easylist、EasylistChina、EasyPrivacy、CJX'sAnnoyance;
3. ad.txt:[推荐移动端]合并自乘风视频广告过滤规则、EasylistChina、EasylistLite、CJX'sAnnoyance,以及补充的一些规则;
4. ad2.txt:合并自乘风视频广告过滤规则、EasylistChina、EasylistLite、CJX'sAnnoyance;
5. ad3.txt:合并自乘风视频广告过滤规则、EasylistChina、EasylistLite、CJX'sAnnoyance、EasyPrivacy;
6. ad-edentw.txt:合并自Adblock Warning Removal List、ABP filters、anti-adblock-killer-filters。
Loading

0 comments on commit 05bdb3f

Please sign in to comment.