This document outlines the steps for releasing a new version of Bollard. Follow these instructions carefully to ensure a smooth release process.
- Identify the Moby API release to support and update the
inputSpecURL incodegen/swagger/pom.xml. - Confirm that the URL references the intended immutable Moby release.
Run the preferred workflow from the repository root:
cargo xtask buildkit update
cargo xtask buildkit checkupdate derives the immutable Moby and BuildKit compatibility baseline from
codegen/swagger/pom.xml, fetches the dependency-classified protobuf sources,
applies named transformations with exact match counts, and stages source and
transformed-output hashes. It replaces checked-in resources only after the
complete preparation succeeds, then writes the complete provenance lock
atomically. check enforces the lock without network access; use
cargo xtask buildkit check --online during release preparation to re-fetch and
verify upstream source hashes. The xtask uses the vendored protoc and exact
generator versions recorded in the provenance lock; do not set PROTOC or
PROTOC_INCLUDE while running it.
- Check for transient dependency updates between
bollardandbollard-buildkit-proto(e.g.,tonic). - Run both provenance checks and review the lock, resource, and generated Rust
diffs:
cargo xtask buildkit check cargo xtask buildkit check --online
- Review the provenance and generated Rust diffs.
- Verify the build and full test suite, including clippy, formatting, semver, and audit checks.
- Check for transient dependency updates between
bollardandbollard-buildkit-proto(e.g.,chrono). - Update the
packageVersionfield:- The first two numbers represent the Moby API version.
- The third number corresponds to Bollard's internal codegen version.
- The digits following
rcmatch the Moby release tag. - Format:
[API-major].[API-minor].[bollard-codegen-version]-rc.[moby-tag-major][moby-tag-minor].[moby-tag-patch].
- Modify
Cargo.mustacheto reference the newbollard-buildkit-protoversion. - Generate the new Swagger bindings:
mvn -D org.slf4j.simpleLogger.defaultLogLevel=warn clean compiler:compile generate-resources
- Validate the build:
- Run a build in the root directory.
- Temporarily add a path dependency in
Cargo.tomlto verify correctness.
- Review the generated Swagger diff alongside the protobuf diff. Do not run
cargo fmtover generated Swagger stubs; regenerate them through Maven.
- Package and publish
bollard-buildkit-proto:(cd codegen/proto && cargo package && cargo publish)
- Update the generated stubs and Bollard manifests to reference the released
proto version, then package and publish
bollard-stubs:(cd codegen/swagger && cargo package && cargo publish)
- Update Bollard's dependencies and any generated API or documentation as
needed. Regenerate the README:
cargo readme --no-title > README.md
- Bump the crate version as necessary.
- Package and publish the release:
cargo package cargo publish
- Create a GitHub Release tag (this should be autogenerated).
Following these steps ensures consistency and reliability when publishing new versions of Bollard. If any issues arise, review the steps carefully or consult the project maintainers for guidance.