Skip to content

Commit 43cdeb4

Browse files
committed
fix(release): 调整 CI 验证并保留构建缓存
1 parent 906e8bb commit 43cdeb4

4 files changed

Lines changed: 16 additions & 13 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,9 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@v4
3030
- uses: actions-rust-lang/setup-rust-toolchain@v1
31-
with:
32-
components: clippy
3331
- name: Install system dependencies
3432
if: ${{ matrix.run_on != 'windows-latest' }}
3533
run: script/bootstrap
36-
- name: Machete
37-
if: ${{ matrix.run_on == 'macos-latest' }}
38-
uses: bnjbvr/cargo-machete@v0.9.1
3934
- name: Setup | Cache Cargo
4035
uses: actions/cache@v4
4136
with:
@@ -45,10 +40,6 @@ jobs:
4540
~/.cargo/git/db/
4641
target/
4742
key: test-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
48-
- name: Lint
49-
if: ${{ matrix.run_on == 'macos-latest' }}
50-
run: |
51-
cargo clippy --workspace --all-targets
5243
- name: Test Linux
5344
if: ${{ matrix.run_on == 'ubuntu-latest' }}
5445
run: |

‎.github/workflows/release.yml‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
tags:
55
- "v*"
66
workflow_dispatch:
7+
inputs:
8+
keep_build_cache:
9+
description: "Restore and save Cargo build cache for faster release builds"
10+
type: boolean
11+
default: true
712

813
permissions:
914
contents: write
@@ -96,15 +101,18 @@ jobs:
96101
cmake --version
97102
98103
- name: Cache Cargo
104+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.keep_build_cache }}
99105
uses: actions/cache@v4
100106
with:
101107
path: |
102108
~/.cargo/registry/index/
103109
~/.cargo/registry/cache/
104110
~/.cargo/git/db/
105-
key: build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
111+
target/
112+
key: release-cargo-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }}
106113
restore-keys: |
107-
build-${{ matrix.target }}-
114+
release-cargo-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}-
115+
release-cargo-${{ runner.os }}-${{ matrix.target }}-
108116
109117
- name: Set environment variables
110118
shell: bash
@@ -157,7 +165,7 @@ jobs:
157165
158166
159167
- name: Clean build artifacts (macOS)
160-
if: runner.os == 'macOS'
168+
if: ${{ runner.os == 'macOS' && github.event_name == 'workflow_dispatch' && inputs.keep_build_cache == false }}
161169
run: |
162170
rm -rf target/debug
163171
find target -name "incremental" -o -name "deps" -o -name "build" | xargs rm -rf || true

‎Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎main/src/public_mcp_runtime.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ pub use config::{PublicMcpEnvOverride, PublicMcpStartConfig};
1010
pub use session::{mcp_server_enabled, set_mcp_server_enabled, set_mcp_server_mode};
1111
pub use status::PublicMcpRuntimeStatus;
1212

13+
#[cfg_attr(
14+
target_os = "windows",
15+
expect(dead_code, reason = "Windows 暂时禁用 CLI 入口,后续拆分独立 CLI")
16+
)]
1317
pub(crate) fn cli_tool_registry() -> anyhow::Result<tool_runtime::ToolRegistry> {
1418
let storage = one_core::storage::StorageManager::new()?;
1519
let repo = std::sync::Arc::new(one_core::storage::ConnectionRepository::new(

0 commit comments

Comments
 (0)