Skip to content

Commit a98b730

Browse files
chore(release): 0.3.1 with workspace split (#186)
## Motivation Releasing 0.3.0 required a working-tree hack: the test harness depends on `trussed-staging`, which isn't on crates.io and won't be published, so its presence in the dev-deps blocked `cargo publish`. Each release otherwise needs a manual dance to comment things out and revert. Splitting the trussed-coupled test code into a non-published sibling crate makes `cargo publish` clean and removes the recurring chore. ## Summary Splits the repo into a Cargo workspace with two members: - `libwebauthn` (publishable). Adds an opt-in `virt` feature that exposes a small `HidPipeBackend` trait and a `virtual_device(backend)` constructor. No trussed coupling in the published crate. - `libwebauthn-tests` (`publish = false`). Owns the trussed-staging-backed `TrussedVirtBackend` impl plus all integration tests. `cargo publish -p libwebauthn` now works without any working-tree hacks. The workspace `[patch.crates-io]` keeps the trussed git pins for tests. ## Notable changes - `cfg(test)` gates that integrated virt into production types in `transport/hid/{device,channel}.rs`, `transport/{mod,channel}.rs` are now `cfg(feature = "virt")`. Same for the `pin_protocol_override` hook and the test-only `PartialEq` impls in `lib.rs`. - `ctap2_preflight` is now `pub` so the preflight tests can run as integration tests in libwebauthn-tests. - The panic/unwrap deny lints in `lib.rs` are gated by `not(any(test, feature = "virt"))` so the virt code path may use them. - CI runs against the workspace (`cargo build --workspace`, `cargo test --workspace`, etc.) and now also runs `cargo publish --dry-run -p libwebauthn` as a check. ## Test plan - [x] `cargo build -p libwebauthn` (no virt feature) - [x] `cargo build -p libwebauthn --features virt` - [x] `cargo build --workspace --all-targets --all-features` - [x] `cargo fmt --all -- --check` - [x] `cargo clippy --workspace --all-targets --all-features -- -D warnings` - [x] `cargo test --workspace` (134 tests pass) - [x] `cargo publish --dry-run -p libwebauthn` (clean, no hacks)
1 parent 1f05a58 commit a98b730

28 files changed

Lines changed: 1103 additions & 960 deletions

.github/workflows/rust-clippy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
- name: Run rust-clippy
4545
run:
4646
cargo clippy
47+
--workspace
4748
--all-features
4849
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
4950
continue-on-error: true

.github/workflows/rust.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ jobs:
77
RUST_LOG: debug
88
name: Build and run tests
99
runs-on: ubuntu-latest
10-
# Set the default working directory for all 'run' steps in this job
11-
defaults:
12-
run:
13-
working-directory: libwebauthn/
1410
steps:
1511
- uses: actions/checkout@v2
1612
- name: Checkout submodules
@@ -20,10 +16,12 @@ jobs:
2016
- name: Install system dependencies
2117
run: sudo apt-get install libudev-dev libdbus-1-dev libsodium-dev libnfc-dev libpcsclite-dev
2218
- name: Clippy
23-
run: cargo clippy --all-targets --all-features -- -D warnings
19+
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
2420
- name: Check formatting
25-
run: cargo fmt -- --check
21+
run: cargo fmt --all -- --check
2622
- name: Build
27-
run: cargo build --all-targets --all-features
23+
run: cargo build --workspace --all-targets --all-features
2824
- name: Run tests
29-
run: cargo test --verbose
25+
run: cargo test --workspace --verbose
26+
- name: Verify libwebauthn publishes cleanly
27+
run: cargo publish --dry-run -p libwebauthn

0 commit comments

Comments
 (0)