@@ -110,17 +110,9 @@ jobs:
110110 mv -f ./mydata/cn-lite ./mydata/cn
111111 go run ./ --datapath=./mydata/ --outputname geosite-mini.dat
112112
113- - name : Generate `sing-box` geodata
114- run : |
115- cd ./community/ || exit 1
116- go install -trimpath -ldflags="-s -w -buildid=" github.com/metacubex/geo/cmd/geo@master
117- for file in $(ls *.dat | sed 's/\.dat$//'); do
118- geo convert site -i v2ray -o sing -f "./${file}.db" "./${file}.dat"
119- done
120-
121113 - name : Get geoip relative files
122114 run : |
123- mkdir -p ./mihomo-geodata/ ./sing-box-geodata/
115+ mkdir -p ./mihomo-geodata/
124116 # Download mihomo geoip files (.mmdb)
125117 mihomo_mmdb=($(curl -sSL https://api.github.com/repos/DustinWin/geoip/releases | grep '"browser_download_url"' | grep '.mmdb' | awk -F '"' '{print $4}'))
126118 count_mihomo_mmdb=${#mihomo_mmdb[@]}
@@ -135,22 +127,12 @@ jobs:
135127 wget -P ./community/ "${mihomo_others[i]}"
136128 done
137129
138- # Download `sing-box` all geoip files
139- singbox_all=($(curl -sSL https://api.github.com/repos/DustinWin/geoip/releases | grep '"browser_download_url"' | grep '/sing-box-geodata/' | awk -F '"' '{print $4}'))
140- count_singbox_all=${#singbox_all[@]}
141- for ((i = 0; i < count_singbox_all; i++)); do
142- wget -P ./community/ "${singbox_all[i]}"
143- done
144-
145- - name : Move `mihomo` and `sing-box` geodata files
130+ - name : Move `mihomo` geodata files
146131 run : |
147132 cd ./community/ || exit 1
148133 for file in $(ls *.dat *.metadb); do
149134 install -Dp "./${file}" ../mihomo-geodata/
150135 done
151- for file in $(ls *.db); do
152- install -Dp "./${file}" ../sing-box-geodata/
153- done
154136 rm -rf ../custom* ../community*
155137
156138 - name : Download `mihomo` rule-set files
@@ -352,30 +334,6 @@ jobs:
352334 git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
353335 git push -f origin mihomo-ruleset
354336
355- - name : Release and upload `sing-box-geodata` assets
356- uses : svenstaro/upload-release-action@v2
357- with :
358- repo_token : ${{ secrets.GITHUB_TOKEN }}
359- release_name : sing-box-geodata
360- tag : sing-box-geodata
361- overwrite : true
362- body : |
363- [sing-box 内核](https://github.com/SagerNet/sing-box) geodata 文件
364- geodata 文件更新于 ${{ env.update_version }}
365- file_glob : true
366- file : ./sing-box-geodata/*
367-
368- - name : Commit and push `sing-box-geodata` branch
369- run : |
370- cd ./sing-box-geodata/ || exit 1
371- git init
372- git config --local user.email "github-actions[bot]@users.noreply.github.com"
373- git config --local user.name "github-actions[bot]"
374- git checkout -b sing-box-geodata
375- git add . && git commit -m "sing-box 内核 geodata 文件更新于 ${update_version}"
376- git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
377- git push -f origin sing-box-geodata
378-
379337 - name : Release and upload `sing-box-ruleset-compatible` assets
380338 uses : svenstaro/upload-release-action@v2
381339 with :
@@ -448,10 +406,6 @@ jobs:
448406 for file in $(ls); do
449407 curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@mihomo-geodata/${file}"
450408 done
451- cd ../sing-box-geodata/ || exit 1
452- for file in $(ls); do
453- curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@sing-box-geodata/${file}"
454- done
455409 cd ../mihomo-ruleset/ || exit 1
456410 for file in $(ls); do
457411 curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@mihomo-ruleset/${file}"
0 commit comments