Skip to content

Commit

Permalink
modify CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackhr-arch committed Jun 27, 2024
1 parent c72df07 commit 67b6397
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 117 deletions.
60 changes: 59 additions & 1 deletion .github/workflows/rust.yml → .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,64 @@ jobs:
path: artifacts
retention-days: 5

build-linux-arm64:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Mihomo
run: |
wget --output-document mihomo.gz https://github.com/MetaCubeX/mihomo/releases/download/v1.18.4/mihomo-linux-amd64-v1.18.4.gz
gunzip mihomo.gz
chmod +x mihomo
nohup ./mihomo -d Example -f Example/basic_clash_config.yaml &
- name: Cache Target
uses: actions/cache@v4
with:
path: |
./clashtui/target
~/.cargo
key: ci-${{ runner.os }}-arm64-${{ hashFiles('./clashtui/Cargo.lock') }}
restore-keys: |
ci-${{ runner.os }}-arm64-${{ hashFiles('./clashtui/Cargo.lock') }}
ci-${{ runner.os }}-arm64-
- name: Download Dependencies
run: |
cd clashtui
rustup target add aarch64-unknown-linux-gnu
cargo install cargo-zigbuild
cargo fetch
- name: Run tests
run: cd clashtui && cargo test --all --verbose

- name: Build
run: |
cd clashtui
cargo zigbuild --target aarch64-unknown-linux-gnu.2.17 --all-features --verbose --locked
cargo zigbuild --target aarch64-unknown-linux-gnu.2.17 --release --locked
- name: Build Version
run: echo "Refer to build-linux"

- name: Pre Upload
run: |
mkdir artifacts
mv ./clashtui/target/release/clashtui ./artifacts/clashtui.arm64.release
mv ./clashtui/target/debug/clashtui ./artifacts/clashtui.arm64.debug
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: Linux_Arm64_Build
path: artifacts
retention-days: 5

build-windows:
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -114,7 +172,7 @@ jobs:
release:
runs-on: ubuntu-latest

needs: [build-linux, build-windows]
needs: [build-linux, build-linux-arm64, build-windows]

if: startsWith(github.ref, 'refs/tags/')

Expand Down
113 changes: 0 additions & 113 deletions .github/workflows/build_release.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: cd clashtui && cargo test --all --verbose

- name: Build Version
run: cd clashtui && cargo r -- -v
run: cd clashtui && cargo r -- -V

- name: Pre Upload
run: |
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
# run: cd clashtui && cargo test --all --verbose

- name: Build Version
run: cd clashtui && cargo r -- -v
run: cd clashtui && cargo r -- -V

- name: Pre Upload
run: |
Expand Down
2 changes: 1 addition & 1 deletion clashtui/api/src/clash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Resp {
std::io::copy(&mut inner, w)
}
}
#[cfg_attr(debug_assertions, derive(Debug))]
#[derive(Debug)]
pub struct ClashUtil {
api: String,
secret: Option<String>,
Expand Down

0 comments on commit 67b6397

Please sign in to comment.