Skip to content

Build

Build #1730

Workflow file for this run

name: Build
on:
workflow_dispatch:
schedule:
- cron: "00 03 * * *"
push:
branches:
- main
paths-ignore:
- "**/README.md"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Prepare Workstation
shell: bash
run: |
git config --global init.defaultBranch main
mkdir -p ./publish
- name: Get dnsmasq-china-list
run: |
git clone --depth 1 https://github.com/felixonmars/dnsmasq-china-list.git
cd dnsmasq-china-list
# base file
make raw
cat accelerated-domains.china.raw.txt apple.china.raw.txt > all.txt
# raw file
cp all.txt ../publish/domain.txt
# unbound
sed -e 's|\(.*\)|forward-zone:\n name: "\1."\n forward-addr: "223.5.5.5"\n |' all.txt > ../publish/unbound.conf
# unbound ipv6 upstream
sed -e 's|\(.*\)|forward-zone:\n name: "\1."\n forward-addr: "223.5.5.5"\n forward-addr: "2400:3200::1"\n|' all.txt > ../publish/unbound-ipv6.conf
# dnscrypt-proxy
sed -e 's|\(.*\)|\1 223.5.5.5,223.6.6.6|' all.txt > ../publish/forwarding-rules.txt
# shadowsocket
sed 's/^/DOMAIN\-SUFFIX\,/' all.txt > ../publish/rocket.txt
- name: Git push assets to "release" branch
run: |
cd publish || exit 1
git init
git config --local user.name "github-actions"
git config --local user.email "github-actions@github.com"
git checkout -b release
git add --all
git commit -m "sync"
git remote add china-domain-list "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push -f china-domain-list release