Build #19441
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
name: Build | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "*/360 * * * *" | |
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 publish | |
- name: build no-cn list | |
run: | | |
export proxy=publish/proxy.txt | |
curl -L 'https://raw.githubusercontent.com/v2fly/domain-list-community/release/geolocation-!cn.txt' | sed '/[@ads@cn]$/d' > $proxy | |
sed -i 's/domain\:/DOMAIN\-SUFFIX,/' $proxy | |
sed -i 's/full\:/DOMAIN,/' $proxy | |
sed -i 's/regexp\:/URL\-REGEX,/' $proxy | |
- name: build china ip list | |
run: | | |
curl -L https://raw.githubusercontent.com/carrnot/china-ip-list/main/private.txt | sed 's/^/IP\-CIDR\,/' > publish/direct-ip.txt | |
curl -L https://raw.githubusercontent.com/carrnot/china-ip-list/release/ip.txt | sed 's/^/IP\-CIDR\,/' >> publish/direct-ip.txt | |
- name: build china domain list | |
run: | | |
curl -L https://raw.githubusercontent.com/carrnot/china-domain-list/release/domain.txt | sed 's/^/\./' > publish/direct-name.txt | |
- name: build china hosts list | |
run: | | |
echo "[Host]" > hosts.txt | |
echo "" >> hosts.txt | |
curl -L https://raw.githubusercontent.com/carrnot/china-domain-list/release/domain.txt | sed 's/^/+\./' | sed -e "s|\(.*\)|\1 = server:223.5.5.5|" >> hosts.txt | |
mv hosts.txt publish/ | |
- name: build ads list | |
run: | | |
curl -L https://raw.githubusercontent.com/bigdargon/hostsVN/master/option/hostsVN-surge-rule.conf > publish/reject.txt | |
- name: build mmdb ip | |
run: | | |
wget https://github.com/carrnot/mmdb-go/releases/download/1.0/mmdb-go-linux64.tar.gz | |
tar -xzvf mmdb-go-linux64.tar.gz | |
curl -L https://raw.githubusercontent.com/carrnot/china-ip-list/release/ip.txt -o ip.txt | |
./mmdb-go -i ip.txt -o publish/Country.mmdb | |
- 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 shadowrocket-rules "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" | |
git push -f shadowrocket-rules release |