Merge pull request #1069 from arfshl/15 #43
This file contains hidden or 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
| 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.x" | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "lts/*" | |
| - 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 }} |