-
Notifications
You must be signed in to change notification settings - Fork 55
79 lines (66 loc) · 3.47 KB
/
autobuild.yml
File metadata and controls
79 lines (66 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: autobuild
on:
workflow_dispatch:
push:
branches:
- master
paths:
- src/**
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
- name: Install tools
run: |
python -m pip install --upgrade pip
pip install python-abp adblock-decoder
npm install -g fop-cli
- name: Run FOP
run: fop -n src/
- name: Build ABP subscriptions
run: |
mkdir -p subscriptions
flrender -i abpindo=. abpindo.template subscriptions/abpindo.txt
flrender -i abpindo=. abpindo_noadult.template subscriptions/abpindo_noadult.txt
flrender -i abpindo=. abpindo_noelemhide.template subscriptions/abpindo_noelemhide.txt
flrender -i abpindo=. abpindo_annoyances.template subscriptions/abpindo_annoyances.txt
flrender -i abpindo=. abpindo_extended.template subscriptions/abpindo_extended.txt
flrender -i abpindo=. abpindo_hosts.template subscriptions/abpindo_hosts.txt
flrender -i abpindo=. abpindo_hosts_adult.template subscriptions/abpindo_hosts_adult.txt
- name: Build DNS filters
run: |
adblock2hosts --ip 0.0.0.0 -o subscriptions/hosts.txt subscriptions/abpindo_hosts.txt
adblock2hosts --ip 0.0.0.0 -o subscriptions/hosts_adult.txt subscriptions/abpindo_hosts_adult.txt
adblock2plain -o subscriptions/domain.txt subscriptions/abpindo_hosts.txt
adblock2plain -o subscriptions/domain_adult.txt subscriptions/abpindo_hosts_adult.txt
python tools/dns_converter.py --format dnsmasq_address subscriptions/hosts.txt subscriptions/dnsmasq.txt
python tools/dns_converter.py --format dnsmasq_address subscriptions/hosts_adult.txt subscriptions/dnsmasq_adult.txt
python tools/dns_converter.py --format dnsmasq_server subscriptions/hosts.txt subscriptions/dnsmasq_server.txt
python tools/dns_converter.py --format dnsmasq_server subscriptions/hosts_adult.txt subscriptions/dnsmasq_adult_server.txt
python tools/dns_converter.py --format rpz subscriptions/hosts.txt subscriptions/rpz.txt
python tools/dns_converter.py --format rpz subscriptions/hosts_adult.txt subscriptions/rpz_adult.txt
python tools/dns_converter.py --format aghome subscriptions/hosts.txt subscriptions/aghome.txt
python tools/dns_converter.py --format aghome subscriptions/hosts_adult.txt subscriptions/aghome_adult.txt
python tools/dns_converter.py --format unbound subscriptions/hosts.txt subscriptions/unbound.txt
python tools/dns_converter.py --format unbound subscriptions/hosts_adult.txt subscriptions/unbound_adult.txt
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add subscriptions/
git diff --staged --quiet && echo "No changes to commit." && exit 0
git commit -m "chore: auto-build subscriptions [skip ci]"
git push
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}