Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Switch to Mihomo #63

Merged
merged 12 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:

name: ToMoon Auto Build

permissions:
contents: write

jobs:
linux_amd64:
name: Linux AMD64
Expand All @@ -15,9 +18,20 @@ jobs:
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: download asset files
run: wget https://github.com/YukiCoco/ToMoon/releases/download/build/build_assets.zip
- run: unzip -n build_assets.zip -d tmp/
- name: Download Clash and Yacd
run: |
mkdir tmp && cd tmp
mkdir core && cd core
# Mihomo (Clash Meta)
wget -O clash.gz https://github.com/MetaCubeX/mihomo/releases/download/v1.18.3/mihomo-linux-amd64-v1.18.3.gz
gzip -d clash.gz
# country.mmdb
wget https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country.mmdb
# yacd
wget -O yacd.zip https://github.com/MetaCubeX/yacd/archive/gh-pages.zip
unzip yacd.zip
mv Yacd-meta-gh-pages web

# build front-end start
- uses: actions/setup-node@v3
with:
Expand All @@ -27,7 +41,7 @@ jobs:
version: 7.12.2
- name: Install Requestment
run: |
cp -r tmp/usdpl src/
cp -r usdpl src/
pnpm i
- name: build front end
run: pnpm run build
Expand All @@ -40,13 +54,12 @@ jobs:
# build front-end end
# build backend start
- uses: dtolnay/rust-toolchain@stable
- uses: ClementTsang/[email protected].2
- uses: ClementTsang/[email protected].6
with:
command: build
directory: ./backend
args: --target x86_64-unknown-linux-gnu --release
use-cross: true
cross-version: 0.2.4
use-cross: false
# build backend end
#build tomoon stop
#output: # ToMoon/backend/target/x86_64-unknown-linux-gnu/release/tomoon
Expand All @@ -65,7 +78,7 @@ jobs:
# with:
# node-version: 16
# - run: pnpm run build
- name: colect files
- name: collect files
run: |
mkdir -p ./release/tomoon/bin/core/web
mkdir -p ./release/tomoon/dist
Expand All @@ -75,7 +88,6 @@ jobs:
cp plugin.json ./release/tomoon/plugin.json
cp package.json ./release/tomoon/package.json
cp -r ./tmp/core ./release/tomoon/bin/
cp -r ./tmp/smartdns ./release/tomoon/bin/
cp -r ./tomoon-web/dist ./release/tomoon/web
cp -r ./py_modules ./release/tomoon/py_modules
cd ./release
Expand Down
2 changes: 1 addition & 1 deletion backend/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn set_clash_status(runtime: &ControlRuntime) -> impl Fn(Vec<Primitive>) ->
}
}
if *enabled {
match clash.run(&settings.current_sub, settings.skip_proxy) {
match clash.run(&settings.current_sub, settings.skip_proxy, settings.override_dns) {
Ok(_) => (),
Err(e) => {
log::error!("Run clash error: {}", e);
Expand Down
Loading