Repository navigation
v0.0.2 - Fix publish.yml (#7)
🌟 Summary
v0.0.2 makes the Rust template’s release process much smarter and safer 🎛️—automating version/tag handling, AI-powered release notes, secure crate publishing, and SBOM generation, with strong quality gates on every release.
📊 Key Changes
-
♻️ Stronger, simpler publish workflow (
publish.yml)- Renamed workflow to “Publish to crates.io” and tightened triggers to
mainbranch pushes and manual runs. - Removed confusing
dry_runlogic in favor of a cleaner, version-based flow. - Restricts automated publishing to the official repo and a specific actor for extra safety.
- Renamed workflow to “Publish to crates.io” and tightened triggers to
-
🧠 Automatic version & tag detection from
Cargo.toml- New Python-based
check_versionstep reads the crate version directly fromCargo.toml. - Derives the matching Git tag (
vX.Y.Z), checks both local and remote tags, and decides if this is a new version (incrementflag). - Avoids accidental re-publishing of the same version to crates.io.
- New Python-based
-
🏷️ Automatic tagging + AI-generated release summaries
- On a new version, the workflow now:
- Creates and pushes an annotated Git tag (e.g.
v0.0.2) using the latest commit message. - Runs
ultralytics-actions-summarize-releaseto auto-generate release notes using AI (OpenAI) and GitHub metadata.
- Creates and pushes an annotated Git tag (e.g.
- Keeps release notes consistent and easier to read for users.
- On a new version, the workflow now:
-
🧪 Full Rust checks before any publish
- New dedicated
buildjob runs on new versions only:cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all --all-features
- Publishing to crates.io only happens if formatting, linting, and tests all pass ✅.
- New dedicated
-
📦 Controlled crate publishing step
publishjob depends on bothcheckandbuildand only runs when a new version is detected.- Publishes to crates.io with
cargo publishusingCARGO_REGISTRY_TOKEN. - Publishes into a named environment (“Release - crates.io”) with a direct link to the crate.
-
🧯 SBOM generation and attachment to releases
- New
sbomjob runs after publish and build:- Generates
Cargo.lock(if missing). - Uses
anchore/sbom-actionto produce an SPDX JSON SBOM (sbom.spdx.json). - Uploads the SBOM to the corresponding GitHub release via
gh release upload.
- Generates
- Improves supply chain transparency and helps with security/compliance.
- New
-
🤖 AI release notes wired into CI (from PR #6)
publish.ymlinstallsultralytics-actionsand callsultralytics-actions-summarize-release.- Uses
OPENAI_API_KEY,GITHUB_TOKEN/GH_TOKENplusCURRENT_TAGandPREVIOUS_TAGto generate release summaries. - Clearly documents the release process and required secrets in
README.md.
-
📈 Crate version bump
Cargo.tomlupdated from0.0.1→0.0.2to mark this as the next published version.- README gains a “🧾 Releases” section explaining how publishing works, the crate name, tag format, required secrets, and workflow guards.
🎯 Purpose & Impact
-
🔒 Safer, more reliable releases
- Version and tag detection from
Cargo.tomlplus tag existence checks prevent double publishes and mis-tagged releases. - Only new versions trigger full build, publish, and SBOM steps.
- Version and tag detection from
-
🧹 Cleaner, easier-to-understand CI
- Removing
dry_runcomplexity and splittingcheck/build/publish/sbomjobs makes the workflow easier to reason about and debug. - Triggers and permissions are explicit, reducing accidental runs.
- Removing
-
📚 Better communication with users
- AI-generated release notes give clear, consistent summaries of changes with minimal manual effort.
- README documentation helps both Ultralytics contributors and external users understand how and when releases happen.
-
🛡️ Improved security & compliance posture
- SBOM attached to GitHub releases supports dependency auditing, vulnerability scanning, and organizational compliance needs.
- Guardrails (fmt, clippy, tests) ensure that only healthy builds reach crates.io.
-
⚙️ Ready-to-use release template for other Rust projects
- This template now ships with a production-grade publish pipeline: auto-tagging, crates.io publishing, AI notes, and SBOMs.
- Teams can adopt this workflow with minimal changes, accelerating setup for new Rust crates.
What's Changed
- Smart Release Notes by @glenn-jocher in #6
- Fix publish.yml by @glenn-jocher in #7
Full Changelog: v0.0.1...v0.0.2