Skip to content

v0.0.2 - Fix publish.yml (#7)

Choose a tag to compare

@github-actions github-actions released this 27 Nov 09:35
· 113 commits to main since this release
0e2510d

🌟 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 main branch pushes and manual runs.
    • Removed confusing dry_run logic in favor of a cleaner, version-based flow.
    • Restricts automated publishing to the official repo and a specific actor for extra safety.
  • 🧠 Automatic version & tag detection from Cargo.toml

    • New Python-based check_version step reads the crate version directly from Cargo.toml.
    • Derives the matching Git tag (vX.Y.Z), checks both local and remote tags, and decides if this is a new version (increment flag).
    • Avoids accidental re-publishing of the same version to crates.io.
  • 🏷️ 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-release to auto-generate release notes using AI (OpenAI) and GitHub metadata.
    • Keeps release notes consistent and easier to read for users.
  • 🧪 Full Rust checks before any publish

    • New dedicated build job runs on new versions only:
      • cargo fmt --all -- --check
      • cargo clippy --all-targets --all-features -- -D warnings
      • cargo test --all --all-features
    • Publishing to crates.io only happens if formatting, linting, and tests all pass ✅.
  • 📦 Controlled crate publishing step

    • publish job depends on both check and build and only runs when a new version is detected.
    • Publishes to crates.io with cargo publish using CARGO_REGISTRY_TOKEN.
    • Publishes into a named environment (“Release - crates.io”) with a direct link to the crate.
  • 🧯 SBOM generation and attachment to releases

    • New sbom job runs after publish and build:
      • Generates Cargo.lock (if missing).
      • Uses anchore/sbom-action to produce an SPDX JSON SBOM (sbom.spdx.json).
      • Uploads the SBOM to the corresponding GitHub release via gh release upload.
    • Improves supply chain transparency and helps with security/compliance.
  • 🤖 AI release notes wired into CI (from PR #6)

    • publish.yml installs ultralytics-actions and calls ultralytics-actions-summarize-release.
    • Uses OPENAI_API_KEY, GITHUB_TOKEN/GH_TOKEN plus CURRENT_TAG and PREVIOUS_TAG to generate release summaries.
    • Clearly documents the release process and required secrets in README.md.
  • 📈 Crate version bump

    • Cargo.toml updated from 0.0.1 → 0.0.2 to 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.toml plus tag existence checks prevent double publishes and mis-tagged releases.
    • Only new versions trigger full build, publish, and SBOM steps.
  • 🧹 Cleaner, easier-to-understand CI

    • Removing dry_run complexity and splitting check / build / publish / sbom jobs makes the workflow easier to reason about and debug.
    • Triggers and permissions are explicit, reducing accidental runs.
  • 📚 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

Full Changelog: v0.0.1...v0.0.2