diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 4f19418..45ed77d 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -2,6 +2,7 @@ name: CI on: push: + branches: [main] pull_request: jobs: @@ -18,7 +19,7 @@ jobs: extra-conf: | sandbox-fallback = false - # Builds the package with its tests, clippy, rustfmt and the VM test (which needs KVM), and - # evaluates the other outputs + # Builds the package with its tests, runs clippy, rustfmt, shellcheck and the VM test + # (which needs KVM), and evaluates the other outputs - name: Check the flake run: nix flake check -L diff --git a/AGENTS.md b/AGENTS.md index ac3e62c..3bd3845 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -39,7 +39,8 @@ of devenv's scripts, `devenv test` or the demo's host side. errors) and the tests. - `cargo fmt` — the crate is formatted with `rustfmt` (`rustfmt.toml`); run it on code you change. - `nix build` — the package, which also runs the tests. -- CI ([`.gitea/workflows/ci.yaml`](.gitea/workflows/ci.yaml)) runs `nix flake check` on every push: +- CI ([`.gitea/workflows/ci.yaml`](.gitea/workflows/ci.yaml)) runs `nix flake check` for pull + requests and pushes to `main`: the package with its tests, `clippy` (warnings as errors), `fmt` (`cargo fmt --check`), `shellcheck` on `src/**/*.sh` and the VM test. Keep them passing. `nix flake check --no-build` fails where the VM test's keys haven't been built, because the test reads them at evaluation. diff --git a/README.md b/README.md index 0189cad..8fc0de4 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,20 @@ The development environment is [devenv](https://devenv.sh): direnv with `.envrc` and `cargo clippy --all-targets` work there, `devenv test` runs both, and `vm-test` runs the NixOS VM test (needs KVM). See [`AGENTS.md`](AGENTS.md) for conventions. +## Releasing + +Use SemVer for the CLI, request protocol and Nix module options. Bump the patch for +compatible fixes and the minor for compatible features. While the major is zero, +use a minor bump for breaking changes and document how to upgrade. After `1.0.0`, +bump the major for breaking changes. + +1. Set `package.version` in `Cargo.toml` and run `cargo check` to refresh + `Cargo.lock`. The Nix package reads the version from `Cargo.toml`. +2. After the release commit lands on `main` and passes CI, tag it `v` and + push the tag. Keep published tags fixed. +3. Update the `slop-broker` input in nixfiles to `ref=refs/tags/v` and run + `nix flake update slop-broker` there to refresh its lock entry. + ## License MIT; see [`LICENSE`](LICENSE). diff --git a/nix/package.nix b/nix/package.nix index d9d9e6e..8065442 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -4,7 +4,7 @@ let in rustPlatform.buildRustPackage { pname = "slop-broker"; - version = "0.1.0"; + inherit ((builtins.fromTOML (builtins.readFile ../Cargo.toml)).package) version; src = toSource { root = ../.;