diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b61052..d3dda1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,18 @@ jobs: - run: cargo fmt --all -- --check - run: cargo clippy --workspace --all-targets -- -D warnings - run: cargo test --workspace + - name: Verify package READMEs + shell: pwsh + run: | + foreach ($package in @('cathub-protocol', 'cathub')) { + $files = @(& cargo package --list -p $package) + if ($LASTEXITCODE -ne 0) { + throw "cargo package --list failed for $package" + } + if ($files -notcontains 'README.md') { + throw "$package package does not contain README.md" + } + } - run: buf lint dotnet-protocol: diff --git a/.github/workflows/publish-registries.yml b/.github/workflows/publish-registries.yml index 3e8c97d..2cb874d 100644 --- a/.github/workflows/publish-registries.yml +++ b/.github/workflows/publish-registries.yml @@ -6,7 +6,7 @@ on: release_tag: description: Verified GitHub release tag to publish required: true - default: v0.1.0 + default: v0.1.1 type: string permissions: diff --git a/Cargo.lock b/Cargo.lock index 97dcac2..d8b812f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,7 +179,7 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cathub" -version = "0.1.0" +version = "0.1.1" dependencies = [ "async-trait", "bytes", @@ -201,7 +201,7 @@ dependencies = [ [[package]] name = "cathub-protocol" -version = "0.1.0" +version = "0.1.1" dependencies = [ "prost", "protoc-bin-vendored", diff --git a/Cargo.toml b/Cargo.toml index 1cf6a35..fb307aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,11 +6,12 @@ members = [ ] [workspace.package] -version = "0.1.0" +version = "0.1.1" edition = "2021" rust-version = "1.88" license = "MIT" repository = "https://github.com/treitforge/cathub" +readme = "README.md" [workspace.dependencies] async-trait = "0.1" diff --git a/README.md b/README.md index b973394..b1bafda 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,17 @@ after shutdown or a failed client session. ## Install -No public CatHub release has been tagged yet. Until the first release is published, build -the daemon from this repository with Rust 1.88 or newer: +Install the daemon from crates.io with Rust 1.88 or newer: + +```powershell +cargo install cathub --version 0.1.1 +``` + +Alternatively, download the Windows or Linux archive and adjacent SHA-256 checksum from the +[GitHub Releases page](https://github.com/treitforge/cathub/releases). Extract the archive +and place `cathub` or `cathub.exe` on `PATH`. + +To build the daemon from source: ```powershell git clone https://github.com/treitforge/cathub.git @@ -28,14 +37,8 @@ Set-Location cathub cargo build --release -p cathub ``` -The executable is `target\release\cathub.exe` on Windows and -`target/release/cathub` on Linux. Copy it to a directory on `PATH`, or run it by its full -path. - -Tagged releases will provide Windows and Linux archives with adjacent SHA-256 checksum -files on the [GitHub Releases page](https://github.com/treitforge/cathub/releases). After -the daemon crate is published to crates.io, users with a Rust toolchain may instead run -`cargo install cathub --version `. A daemon operator does not need either +The source-built executable is `target\release\cathub.exe` on Windows and +`target/release/cathub` on Linux. A daemon operator does not need either protocol-development package described below. ## Build and test @@ -128,10 +131,11 @@ client/server contract crate. `CatHub.Protocol` is the .NET client package proje protocol packages are for applications that use the typed WinKeyer API and are not required to run the daemon. -The release workflow packages both protocol artifacts into a GitHub release. Publishing the -daemon and protocol crates to crates.io, and the .NET contract to NuGet, are separate -release-authority operations. None of those registry packages exists before publication -succeeds. See +The release workflow packages both protocol artifacts into a GitHub release. Published +client packages are available as +[`cathub-protocol`](https://crates.io/crates/cathub-protocol) for Rust and +[`CatHub.Protocol`](https://www.nuget.org/packages/CatHub.Protocol) for .NET. Registry +publication remains a separate release-authority operation. See [release and compatibility](docs/architecture/release-and-compatibility.md). ## Documentation diff --git a/build.ps1 b/build.ps1 index 0baa144..60e6066 100644 --- a/build.ps1 +++ b/build.ps1 @@ -22,6 +22,18 @@ function Invoke-DotNet { if ($LASTEXITCODE -ne 0) { throw "dotnet failed with exit code $LASTEXITCODE" } } +function Test-CargoPackageReadmes { + foreach ($package in @('cathub-protocol', 'cathub')) { + $files = @(& cargo package --allow-dirty --list -p $package) + if ($LASTEXITCODE -ne 0) { + throw "cargo package --list failed for $package with exit code $LASTEXITCODE" + } + if ($files -notcontains 'README.md') { + throw "$package package does not contain README.md" + } + } +} + Push-Location $root try { switch ($Action) { @@ -47,6 +59,7 @@ try { Invoke-Cargo -CargoArguments @('fmt', '--all', '--', '--check') Invoke-Cargo -CargoArguments @('clippy', '--workspace', '--all-targets', '--', '-D', 'warnings') Invoke-Cargo -CargoArguments @('test', '--workspace') + Test-CargoPackageReadmes & buf lint if ($LASTEXITCODE -ne 0) { throw "buf lint failed with exit code $LASTEXITCODE" } Invoke-DotNet -DotNetArguments @('build', 'CatHub.slnx', '-c', $Configuration) diff --git a/crates/cathub-protocol/Cargo.toml b/crates/cathub-protocol/Cargo.toml index bbf50de..db1ff42 100644 --- a/crates/cathub-protocol/Cargo.toml +++ b/crates/cathub-protocol/Cargo.toml @@ -6,6 +6,7 @@ edition.workspace = true rust-version.workspace = true license.workspace = true repository.workspace = true +readme.workspace = true [dependencies] prost = { workspace = true } diff --git a/crates/cathub/Cargo.toml b/crates/cathub/Cargo.toml index 36224f7..7eb506f 100644 --- a/crates/cathub/Cargo.toml +++ b/crates/cathub/Cargo.toml @@ -6,6 +6,7 @@ edition.workspace = true rust-version.workspace = true license.workspace = true repository.workspace = true +readme.workspace = true [lib] name = "cathub" @@ -18,7 +19,7 @@ path = "src/main.rs" [dependencies] async-trait = { workspace = true } bytes = { workspace = true } -cathub-protocol = { path = "../cathub-protocol", version = "0.1.0" } +cathub-protocol = { path = "../cathub-protocol", version = "0.1.1" } clap = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/docs/architecture/release-and-compatibility.md b/docs/architecture/release-and-compatibility.md index 484c61e..0b840e6 100644 --- a/docs/architecture/release-and-compatibility.md +++ b/docs/architecture/release-and-compatibility.md @@ -25,7 +25,7 @@ set the `NUGET_USER` Actions repository variable to the policy owner's NuGet use dispatch the publication workflow: ```powershell -gh workflow run publish-registries.yml -f release_tag=v0.1.0 +gh workflow run publish-registries.yml -f release_tag=v0.1.1 ``` The workflow rejects a draft or prerelease, verifies every release asset checksum, and checks diff --git a/docs/integration/setup.md b/docs/integration/setup.md index ea463d9..58393aa 100644 --- a/docs/integration/setup.md +++ b/docs/integration/setup.md @@ -11,14 +11,13 @@ Download the matching platform archive from the [GitHub Releases page](https://github.com/treitforge/cathub/releases), verify the adjacent SHA-256 checksum, extract it, and place `cathub` or `cathub.exe` on `PATH`. -If the daemon crate has been published for that version and Rust is already installed, the -equivalent installation is: +If Rust 1.88 or newer is already installed, the equivalent installation from crates.io is: ```powershell -cargo install cathub --version +cargo install cathub --version 0.1.1 ``` -No public release has been tagged yet. Until the first release exists, build from source: +To build from source instead: ```powershell git clone https://github.com/treitforge/cathub.git diff --git a/src/dotnet/CatHub.Protocol/CatHub.Protocol.csproj b/src/dotnet/CatHub.Protocol/CatHub.Protocol.csproj index fea34a6..cdfb7b0 100644 --- a/src/dotnet/CatHub.Protocol/CatHub.Protocol.csproj +++ b/src/dotnet/CatHub.Protocol/CatHub.Protocol.csproj @@ -4,7 +4,7 @@ enable enable CatHub.Protocol - 0.1.0 + 0.1.1 Versioned gRPC client contracts for CatHub. README.md MIT