mirror of
https://github.com/TG-Twilight/AWAvenue-Ads-Rule.git
synced 2025-11-04 14:49:47 +08:00
add mihomo mrs& add AWAvenue-list.txt
Some checks failed
build Rule / execute_python_script (push) Has been cancelled
Some checks failed
build Rule / execute_python_script (push) Has been cancelled
This commit is contained in:
parent
60a611509a
commit
58b2bf9a2b
130
.github/workflows/build.yaml
vendored
130
.github/workflows/build.yaml
vendored
@ -1,58 +1,72 @@
|
|||||||
name: build Rule
|
name: build Rule
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
execute_python_script:
|
execute_python_script:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TZ: Asia/Shanghai # UTC+8
|
TZ: Asia/Shanghai # UTC+8
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: 3.12
|
python-version: 3.12
|
||||||
|
|
||||||
- name: Execute Python script
|
- name: Execute Python script
|
||||||
run: |
|
run: |
|
||||||
git clone "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" -b build build
|
git clone "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" -b build build
|
||||||
cd build
|
cd build
|
||||||
mkdir out
|
mkdir out
|
||||||
python main.py
|
python main.py
|
||||||
cd out
|
cd out
|
||||||
mkdir Filters
|
mkdir Filters
|
||||||
cp -Rf AWAvenue-Ads-Rule-Adblock.txt AWAvenue-Ads-Rule.txt #历史遗留问题
|
cp -Rf AWAvenue-Ads-Rule-Adblock.txt AWAvenue-Ads-Rule.txt #历史遗留问题
|
||||||
mv AWAvenue-Ads-Rule-* Filters/
|
mv AWAvenue-Ads-Rule-* Filters/
|
||||||
|
|
||||||
- name: Git push
|
- name: build mihomo mrs
|
||||||
run: |
|
run: |
|
||||||
git clone "https://${{ github.actor }}:${{ secrets.TOKEN }}@github.com/${{ github.repository }}" push
|
cd build/out/Filters
|
||||||
cp -Rf build/out/* push/
|
wget -O ./mihomo.gz https://github.com/MetaCubeX/mihomo/releases/download/v1.19.12/mihomo-linux-amd64-v1.19.12.gz
|
||||||
cd push
|
gzip -d mihomo.gz
|
||||||
files=$(find . -name '*AWAvenue*')
|
chmod +x mihomo
|
||||||
echo $files
|
./mihomo convert-ruleset domain yaml AWAvenue-Ads-Rule-Clash.yaml AWAvenue-Ads-Rule-Clash.mrs
|
||||||
if [[ -n "$(git diff -- $files)" ]] || [[ "$(echo $(git status) | grep 'Untracked files')" ]]; then
|
rm -rf *mihomo*
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
- name: Create AWAvenue-list.txt
|
||||||
git add AWAvenue-Ads-Rule.txt
|
run: |
|
||||||
cd Filters
|
cd build/out/Filters
|
||||||
git add *AWAvenue*
|
ls | grep -v AWAvenue-list.txt > AWAvenue-list.txt
|
||||||
git commit -m "${{ github.event.head_commit.message }}"
|
|
||||||
git push --set-upstream origin main
|
- name: Git push
|
||||||
fi
|
run: |
|
||||||
|
git clone "https://${{ github.actor }}:${{ secrets.TOKEN }}@github.com/${{ github.repository }}" push
|
||||||
- name: Purge jsdelivr CDN cache
|
cp -Rf build/out/* push/
|
||||||
run: |
|
cd push
|
||||||
cd push/Filters
|
files=$(find . -name '*AWAvenue*')
|
||||||
echo "https://purge.jsdelivr.net/gh/${{ github.repository }}@main/AWAvenue-Ads-Rule.txt"
|
echo $files
|
||||||
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@main/AWAvenue-Ads-Rule.txt"
|
if [[ -n "$(git diff -- $files)" ]] || [[ "$(echo $(git status) | grep 'Untracked files')" ]]; then
|
||||||
for file in $(ls); do
|
git config --local user.name "github-actions[bot]"
|
||||||
echo "https://purge.jsdelivr.net/gh/${{ github.repository }}@main/Filters/${file}"
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@main/Filters/${file}"
|
git add AWAvenue-Ads-Rule.txt
|
||||||
done
|
cd Filters
|
||||||
|
git add *AWAvenue*
|
||||||
|
git commit -m "${{ github.event.head_commit.message }}"
|
||||||
|
git push --set-upstream origin main
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Purge jsdelivr CDN cache
|
||||||
|
run: |
|
||||||
|
cd push/Filters
|
||||||
|
echo "https://purge.jsdelivr.net/gh/${{ github.repository }}@main/AWAvenue-Ads-Rule.txt"
|
||||||
|
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@main/AWAvenue-Ads-Rule.txt"
|
||||||
|
for file in $(ls); do
|
||||||
|
echo "https://purge.jsdelivr.net/gh/${{ github.repository }}@main/Filters/${file}"
|
||||||
|
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@main/Filters/${file}"
|
||||||
|
done
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user