diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1613727..9065394 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,3 +1,8 @@ +# SECURITY: Actions are pinned to release tags, not commit SHAs, so whoever controls an +# action could move its tag and run new code in jobs that hold `id-token` or `contents` +# write permissions. This is accepted because each action comes from GitHub, the Rust +# project, or the maintainer of `dtolnay/rust-toolchain`, who already control the runner, +# the toolchain, or the publishing this workflow trusts; pin them to SHAs if that changes. name: Publish to crates.io on: @@ -22,11 +27,12 @@ jobs: - uses: actions/checkout@v7 with: fetch-depth: 0 + persist-credentials: false - uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt - name: Install Bake launcher - run: cargo install bake --locked + run: cargo install bake --version 0.20.1 --locked - name: Detect an explicit release request id: detect env: @@ -58,9 +64,10 @@ jobs: - uses: actions/checkout@v7 with: fetch-depth: 0 + persist-credentials: false - uses: dtolnay/rust-toolchain@stable - name: Install Bake launcher - run: cargo install bake --locked + run: cargo install bake --version 0.20.1 --locked - name: Find workspace packages that need publishing id: packages env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 31e26dc..521b0bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,9 +33,28 @@ jobs: - name: Run tests and require complete source-region coverage run: cargo bake --locked test:coverage --all-targets true + minimum-rust: + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v7 + - name: Read the declared minimum Rust version + id: rust-version + run: | + version=$(sed -n 's/^rust-version = "\(.*\)"$/\1/p' Cargo.toml | head -n 1) + test -n "$version" || { echo "Cargo.toml declares no rust-version" >&2; exit 1; } + echo "version=$version" >> "$GITHUB_OUTPUT" + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ steps.rust-version.outputs.version }} + - name: Build the publishable packages with the declared minimum Rust version + run: | + packages=$(cargo metadata --no-deps --format-version 1 --locked | jq -r '.packages[] | select(.publish != []) | "--package=\(.name)"') + cargo check $packages --all-targets --locked + test-result: if: always() - needs: [test] + needs: [test, minimum-rust] runs-on: ubuntu-latest timeout-minutes: 5 steps: diff --git a/Cargo.lock b/Cargo.lock index 92922b1..fde8cf5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,11 +17,17 @@ dependencies = [ "memchr", ] +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + [[package]] name = "bake" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88efe853b35d9884106fa487c98f8404dee32c0b5bf1cb704a940e2d57d0d565" +checksum = "e4d2ab164d941afcc49e5c790944f811001e1312922e0d045558f44574853ea7" dependencies = [ "bake-macros", "linkme", @@ -32,22 +38,22 @@ dependencies = [ [[package]] name = "bake-agent-context" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c536a159ae7aa41ed8f5f1accda4dbbb8064eefeec9ca629fb02207f9a397" +checksum = "7c8d805e02acc3a3121a702ea9545c1efe23dfcb955fab58dc0117ca4aa2a145" dependencies = [ "bake", "base-markdown", "serde", "serde_json", - "serde_yaml_ng", + "yaml-rust2", ] [[package]] name = "bake-cargo" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "548b17d1d87637cedfc263dbe3bcb1d4efd8940afa04b6dc49d927a90450141a" +checksum = "38417e4c2a0b8d6d4f84e6be83de0e3b848566ab99a04a53775b7c9811565b99" dependencies = [ "bake", "bake-license", @@ -62,20 +68,21 @@ dependencies = [ [[package]] name = "bake-license" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b873096492b2786ea7c0dd8ccc588b5919a052a13db753a5098950eb5e5e83e" +checksum = "f70e25afc0b76e54a37fbc873430e0add234b4f73c105b70c24fe4cb6036b4fc" dependencies = [ "bake", "base-markdown", "tempfile", + "toml_edit", ] [[package]] name = "bake-macros" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622405b736f9e53ba8d4ec042e24516282247e0c3fb79c33b5fe84e8a94fe622" +checksum = "b9ffa87220f54769e5a6dcef501cfd162edb2de7d5d85362364c9002aea73bee" dependencies = [ "proc-macro2", "quote", @@ -117,9 +124,9 @@ dependencies = [ [[package]] name = "bake-test" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02a9b131698824d0a8e0328e86b1c8d270b4644901a019ac46e4ad38fee005a8" +checksum = "86defb1a5874835378e27f3be338302ef363352b1d3ea9352690a45fdbc27729" dependencies = [ "bake", "serde_json", @@ -273,6 +280,12 @@ dependencies = [ "zlib-rs", ] +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "form_urlencoded" version = "1.2.2" @@ -334,6 +347,18 @@ name = "hashbrown" version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a596f1b20ed2cc5ecac41a164aaebc7258057060f06c0cf7a2ba3991ee7990fb" +dependencies = [ + "hashbrown", +] [[package]] name = "icu_collections" @@ -673,12 +698,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - [[package]] name = "serde" version = "1.0.229" @@ -722,19 +741,6 @@ dependencies = [ "zmij", ] -[[package]] -name = "serde_yaml_ng" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4db627b98b36d4203a7b458cf3573730f2bb591b28871d916dfa9efabfd41f" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "sharded-slab" version = "0.1.7" @@ -941,12 +947,6 @@ version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "untrusted" version = "0.9.0" @@ -1122,6 +1122,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" +[[package]] +name = "yaml-rust2" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57e5b818a27a4cd30884ea380857a5e56f7ec3ba24a3990a3cc0b95af3238e18" +dependencies = [ + "arraydeque", + "hashlink", +] + [[package]] name = "yoke" version = "0.8.4" diff --git a/agents.md b/agents.md index 250cdee..fd0251b 100644 --- a/agents.md +++ b/agents.md @@ -4,4 +4,6 @@ Run `cargo bake agent:context:install` to install dependency context and skills, Before planning or changing behavior, discover and read applicable `design/*.md`. Use `base-design-review` to assess plans and changes, and `base-design-author` when user requirements are introduced, changed, or removed. Review design compliance before opening or updating a pull request. +Use `base-security-audit` when reviewing code for security issues, and record each review in `security/audit-*.md`. Use `base-security-advisory` for vulnerability reports and for findings that may warrant an advisory. Before reporting a security finding, read the relevant `// SECURITY:` comments and `design/*.md`. + Keep runtime dependencies independent of concrete schedulers. Libraries use ordinary `tracing` events; application setup, formatting, and captured failure diagnostics belong here. Development tooling belongs in the private `bake/` package. CI requires complete source-region coverage across all targets: run `cargo bake test:coverage --all-targets true`. diff --git a/bake/Cargo.toml b/bake/Cargo.toml index e4ed143..c233ab8 100644 --- a/bake/Cargo.toml +++ b/bake/Cargo.toml @@ -6,5 +6,5 @@ publish = false [dependencies] bake = ">=0.20, <1" -base-project = ">=0.1.0" +base-project = ">=0.1.7" diff --git a/readme.md b/readme.md index 598d4a1..ffbe3e9 100644 --- a/readme.md +++ b/readme.md @@ -71,7 +71,7 @@ See the [API documentation](https://docs.rs/base-console) for writers, filters, ## Releasing -Prepare a release with `cargo bake cargo:version:patch` (or `minor`, `major`, or `bump --version X.Y.Z`), commit it with a `Release: vVERSION` trailer, then run `cargo bake cargo:release` and open a pull request. After review and merge, GitHub Actions publishes the release when the configured `crates-io` environment approves it, then creates or updates the matching GitHub Release from `releases.md`. Follow the shared [Releasing skill](https://github.com/base-rs/base-project/blob/main/context/releasing.md) for the standard process. +Prepare a release with `cargo bake cargo:release:patch` (or `minor`, `major`, or `bump --version X.Y.Z`), which bumps the version, commits it with a `Release: vVERSION` trailer, validates it and opens the release pull request. After review and merge, GitHub Actions publishes the release when the configured `crates-io` environment approves it, then creates or updates the matching GitHub Release from `releases.md`. Follow the shared [Releasing skill](https://github.com/base-rs/base-project/blob/main/context/releasing.md) for the standard process. ## Releases