Update ECH lists #17
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: Update ECH lists | |
on: | |
push: | |
paths: | |
- 'get_ech.sh' | |
schedule: | |
- cron: '0 0 * * *' # 00:00 UTC | |
workflow_dispatch: | |
jobs: | |
run-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget jq parallel | |
bash <(curl -fsSL https://sing-box.app/deb-install.sh) | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Run script | |
run: | | |
chmod +x get_ech.sh | |
./get_ech.sh | |
mkdir data | |
cp domains_ech.lst data/domains_ech | |
cp domains_noech.lst data/domains_noech | |
- name: Compile .SRS files from .JSON | |
run: | | |
sing-box rule-set compile domains_ech.json -o domains_ech.srs | |
sing-box rule-set compile domains_noech.json -o domains_noech.srs | |
- name: Build ech.dat file | |
run: | | |
go run main.go --outputname=ech.dat | |
- name: Create release and upload assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
no_ech_length=$(wc -l domains_noech.lst | tr ' ' '\n' | head -1) | |
ech_length=$(wc -l domains_ech.lst | tr ' ' '\n' | head -1) | |
release_date=$(date +'%d-%m-%y-%H-%M') | |
gh release create "$release_date" \ | |
amnezia.json \ | |
domains_ech.lst \ | |
domains_ech.srs \ | |
domains_noech.lst \ | |
domains_noech.srs \ | |
domains_noech_dnsmasq.lst \ | |
ech.dat \ | |
--title "$release_date" \ | |
--notes "Доменов с ECH: $ech_length, доменов без ECH: $no_ech_length" |