Add support for mihomo mrs

fix #946
This commit is contained in:
MkQtS 2024-11-01 18:35:27 +08:00 committed by GitHub
parent acc5eccd9c
commit f5afbdcad6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,12 +28,36 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install sing-box sudo apt-get install sing-box
- name: Compile sing-box rule-set - name: Install mihomo
env:
DEBIAN_FRONTEND: noninteractive
run: |
case "$(uname -m)" in
'x86_64') ARCH='amd64' ;;
'x86' | 'i686' | 'i386') ARCH='386' ;;
'aarch64' | 'arm64') ARCH='arm64' ;;
'armv7l') ARCH='armv7' ;;
'riscv64') ARCH='riscv64' ;;
's390x') ARCH='s390x' ;;
*) ARCH='unknown' ;;
esac
echo "The architecture is: $ARCH"
[ "$ARCH" = 'unknown' ] || {
MIHOMO_VER=$(wget -q -O - 'https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/version.txt')
# e.g. alpha-3e966e8
URL='https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/mihomo-linux-'$ARCH'-'$MIHOMO_VER'.deb'
# e.g. https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/mihomo-linux-amd64-alpha-3e966e8.deb
wget -q -O ./mihomo.deb "$URL"
sudo apt install ./mihomo.deb
rm -f ./mihomo.deb
}
- name: Compile binaries for sing-box/mihomo
run: | run: |
sing-box rule-set convert --type adguard ./anti-ad-adguard.txt --output ./anti-ad-sing-box.srs sing-box rule-set convert --type adguard ./anti-ad-adguard.txt --output ./anti-ad-sing-box.srs
echo '========================================'
sha256sum ./anti-ad-sing-box.srs sha256sum ./anti-ad-sing-box.srs
echo '========================================' mihomo convert-ruleset domain yaml ./anti-ad-clash.yaml ./anti-ad-mihomo.mrs
sha256sum ./anti-ad-mihomo.mrs
- name: Copy some list files - name: Copy some list files
run: | run: |
@ -47,6 +71,7 @@ jobs:
cp ./anti-ad-surge.txt ~/website/docs/surge.txt cp ./anti-ad-surge.txt ~/website/docs/surge.txt
cp ./anti-ad-surge2.txt ~/website/docs/surge2.txt cp ./anti-ad-surge2.txt ~/website/docs/surge2.txt
cp ./anti-ad-clash.yaml ~/website/docs/clash.yaml cp ./anti-ad-clash.yaml ~/website/docs/clash.yaml
cp ./anti-ad-mihomo.mrs ~/website/docs/mihomo.mrs
cp ./anti-ad-domains.txt ~/website/docs/domains.txt cp ./anti-ad-domains.txt ~/website/docs/domains.txt
cp ./anti-ad-sing-box.srs ~/website/docs/anti-ad-sing-box.srs cp ./anti-ad-sing-box.srs ~/website/docs/anti-ad-sing-box.srs