-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 19d4091
Showing
6 changed files
with
158,308 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build adblock rules files | ||
|
||
on: | ||
schedule: | ||
- cron: 0 */12 * * * | ||
workflow_dispatch: | ||
|
||
env: | ||
TZ: Asia/Shanghai | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Checkout the branch | ||
uses: actions/checkout@v3 | ||
|
||
- name: Generate adblock files | ||
run: | | ||
mkdir -p ./download/ | ||
chmod +x ./adblock.py | ||
python ./adblock.py | ||
- name: Git push assets to github | ||
run: | | ||
rm -rf .git/ download/ | ||
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
git config --global user.name github-actions[bot] | ||
git init | ||
git add --all | ||
git commit -m "Update $(date -d "8 hour" -u "+%Y-%m-%d %H:%M:%S")" | ||
git branch -M main | ||
git remote add origin "https://${{ github.actor }}:${{ secrets.TOKEN }}@github.com/${{ github.repository }}" | ||
git push -u -f origin main | ||
- name: Purge jsdelivr cache | ||
run: | | ||
result=$(curl -s https://purge.jsdelivr.net/gh/lewime/adblock@master/) | ||
if echo $result | grep -q 'success.*true'; then | ||
echo "jsdelivr cache update success" | ||
else | ||
echo $result | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# bat file | ||
*.bat |
Oops, something went wrong.