Skip to content

Commit dc8d519

Browse files
committed
fix: update publishing workflows to use examples-only feature correctly
1 parent 0c3700c commit dc8d519

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.github/workflows/publish-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- name: Test package with examples-only feature
6969
run: |
7070
echo "Testing package with examples-only feature (no git dependencies)..."
71-
cargo package --features examples-only --verbose
71+
cargo package --features examples-only --no-default-features --verbose
7272
echo "✅ Package builds successfully with examples-only feature"
7373
7474
# Step 6: Test packaging with default features (including MCP)
@@ -88,9 +88,9 @@ jobs:
8888
run: |
8989
echo "Testing example binary compilation..."
9090
# Test a few key examples
91-
cargo build --features examples-only --bin example_01_hello_world
92-
cargo build --features examples-only --bin example_02_calculator
93-
cargo build --features examples-only --bin example_09_database
91+
cargo build --features examples-only --no-default-features --bin example_01_hello_world
92+
cargo build --features examples-only --no-default-features --bin example_02_calculator
93+
cargo build --features examples-only --no-default-features --bin example_09_database
9494
echo "✅ Key examples compile successfully"
9595
9696
# Step 8: Generate package information

.github/workflows/release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,16 @@ jobs:
235235
- name: Verify package
236236
run: |
237237
echo "Verifying package for crates.io publishing..."
238-
cargo package --verbose
239-
cargo package --list
238+
echo "Note: Using examples-only feature to avoid git dependencies"
239+
cargo package --features examples-only --no-default-features --verbose
240+
cargo package --features examples-only --no-default-features --list
240241
241242
# Step 5: Publish to crates.io
242243
- name: Publish to crates.io
243244
run: |
244245
echo "Publishing MCP Rust Examples to crates.io..."
245-
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose
246+
echo "Using examples-only feature for crates.io compatibility"
247+
cargo publish --features examples-only --no-default-features --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose
246248
env:
247249
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
248250

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,15 @@ path = "src/examples/example_20_enterprise_server.rs"
9595

9696
[dependencies]
9797
# Core MCP SDK - using development branch for latest features
98-
# Note: Made optional for crates.io publishing compatibility
98+
# Note: Optional git dependency for MCP functionality
9999
rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", branch = "main", features = [
100100
"server",
101101
"client",
102102
], optional = true }
103103

104+
# Alternative crates.io version (when available)
105+
# rmcp = { version = "0.1", features = ["server", "client"], optional = true }
106+
104107
# Essential async runtime
105108
tokio = { version = "1.0", features = ["full"] }
106109

0 commit comments

Comments
 (0)