Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-registries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,26 @@ 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
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 <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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions crates/cathub-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true

[dependencies]
prost = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion crates/cathub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true

[lib]
name = "cathub"
Expand All @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/release-and-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions docs/integration/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/CatHub.Protocol/CatHub.Protocol.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PackageId>CatHub.Protocol</PackageId>
<Version>0.1.0</Version>
<Version>0.1.1</Version>
<Description>Versioned gRPC client contracts for CatHub.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down