diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1acc080..aabc50a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,58 +60,6 @@ jobs: echo "version=$version" >> "$GITHUB_OUTPUT" echo "tag=$release_tag" >> "$GITHUB_OUTPUT" - validate: - name: Validate source - needs: version - if: github.event_name != 'release' || github.event.release.prerelease == true - runs-on: ubuntu-24.04 - timeout-minutes: 30 - steps: - - uses: actions/checkout@v7 - with: - ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }} - - uses: oven-sh/setup-bun@v2 - with: - bun-version: 1.3.14 - - uses: dtolnay/rust-toolchain@stable - with: - components: clippy, rustfmt - - name: Cache Bun packages - uses: actions/cache@v5 - with: - path: ~/.bun/install/cache - key: bun-${{ runner.os }}-${{ runner.arch }}-1.3.14-${{ hashFiles('bun.lock') }} - restore-keys: | - bun-${{ runner.os }}-${{ runner.arch }}-1.3.14- - - name: Cache Rust dependencies - uses: Swatinem/rust-cache@v2 - with: - workspaces: src-tauri -> target - cache-on-failure: true - - name: Apply release version - run: node scripts/set-version.mjs "${{ needs.version.outputs.version }}" - - name: Install Linux dependencies - run: | - sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf - - name: Install frontend dependencies - run: bun install --frozen-lockfile - - name: Validate desktop icons - shell: bash - run: | - test -s src-tauri/icons/icon.png - test -s src-tauri/icons/icon.ico - test -s src-tauri/icons/icon.icns - - name: Validate frontend - run: | - bun run check - bun test - - name: Validate Rust - run: | - cargo fmt --manifest-path src-tauri/Cargo.toml -- --check - cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings - cargo test --manifest-path src-tauri/Cargo.toml - build: name: Build ${{ matrix.os }}-${{ matrix.arch }} needs: version @@ -152,8 +100,6 @@ jobs: suffix: zip runs-on: ${{ matrix.runner }} timeout-minutes: 60 - env: - RUSTFLAGS: -D warnings steps: - uses: actions/checkout@v7 with: @@ -455,7 +401,6 @@ jobs: || inputs.release_tag != '' needs: - version - - validate - build runs-on: ubuntu-24.04 timeout-minutes: 15 diff --git a/src-tauri/src/agents/discovery.rs b/src-tauri/src/agents/discovery.rs index 131d80f..a73aa08 100644 --- a/src-tauri/src/agents/discovery.rs +++ b/src-tauri/src/agents/discovery.rs @@ -1975,11 +1975,11 @@ pub(crate) fn command_output_with_timeout( let mut stdout = child .stdout .take() - .ok_or_else(|| io::Error::new(io::ErrorKind::Other, "无法读取智能体探测标准输出"))?; + .ok_or_else(|| io::Error::other("无法读取智能体探测标准输出"))?; let mut stderr = child .stderr .take() - .ok_or_else(|| io::Error::new(io::ErrorKind::Other, "无法读取智能体探测错误输出"))?; + .ok_or_else(|| io::Error::other("无法读取智能体探测错误输出"))?; thread::scope(|scope| { let stdout_reader = scope.spawn(move || { let mut output = Vec::new(); @@ -2002,10 +2002,10 @@ pub(crate) fn command_output_with_timeout( }; let stdout = stdout_reader .join() - .map_err(|_| io::Error::new(io::ErrorKind::Other, "智能体探测输出线程异常退出"))??; + .map_err(|_| io::Error::other("智能体探测输出线程异常退出"))??; let stderr = stderr_reader .join() - .map_err(|_| io::Error::new(io::ErrorKind::Other, "智能体探测错误线程异常退出"))??; + .map_err(|_| io::Error::other("智能体探测错误线程异常退出"))??; Ok(status.map(|status| std::process::Output { status, stdout,