Skip to content

ci: tag-driven release with auto-generated notes#12

Merged
singaraiona merged 1 commit intomainfrom
ci/tag-driven-release
May 1, 2026
Merged

ci: tag-driven release with auto-generated notes#12
singaraiona merged 1 commit intomainfrom
ci/tag-driven-release

Conversation

@singaraiona
Copy link
Copy Markdown
Contributor

What this changes

Rewrite .github/workflows/publish.yml so that pushing a vX.Y.Z tag triggers a full release pipeline:

  1. Verify the tag matches Cargo.toml's version field (fail loudly on drift).
  2. Vendor rayforce at the pinned SHA (existing behavior).
  3. Test with cargo test.
  4. Publish to crates.io, idempotent (skips if the version is already there).
  5. Generate release notes by grouping conventional-commit subjects since the previous tag into Features / Bug fixes / Performance / Refactoring / Documentation / Build & CI / Chores / Other, with a "Full changelog" link.
  6. Create GitHub Release with those notes (or update notes on a pre-existing release).
  7. Smoke test the published crate (cargo install plus downstream cargo check).

Bug fixes vs the prior workflow

  • version_of previously read crates/raysense/Cargo.toml, which never existed in the single-crate layout. Now reads the root Cargo.toml.
  • Trigger was release: published, requiring you to hand-create the GitHub Release before automation kicked in. Now the tag IS the trigger, and the release is created automatically with auto-generated notes.

Manual dry-run

Actions -> publish -> Run workflow with dry_run: true (default) runs cargo package + cargo publish --dry-run and skips release creation and smoke test. Validates the pipeline without actually publishing.

Prereq for the first real release

  • CARGO_REGISTRY_TOKEN secret must be set on the repo (Settings -> Secrets and variables -> Actions). The prior workflow already referenced it; if it's set, you're done.

After this PR merges

Cut the first release with:

git tag v0.2.0
git push origin v0.2.0

The workflow handles the rest. Inspect the resulting release and verify notes look right; if not, the workflow can be re-run with Actions -> publish -> Run workflow -> dry_run: true to iterate on the formatting.

Test plan

  • Merge this PR, then Actions -> publish -> Run workflow -> dry_run: true once to confirm cargo package and cargo publish --dry-run succeed end-to-end on the runner.
  • Push tag v0.2.0 and verify: release is created with grouped commit notes, crates.io shows raysense 0.2.0, post-release smoke step succeeds.

Rewrite publish.yml to be triggered by `vX.Y.Z` tag pushes (or a
manual dispatch for dry-run). On a real release tag, the workflow:

  1. Verifies the tag matches Cargo.toml's version field, fails
     loudly if they drift.
  2. Vendors rayforce at the pinned SHA (existing behavior).
  3. Runs `cargo test`.
  4. Publishes to crates.io, idempotent (skips if the version is
     already there).
  5. Generates release notes by grouping conventional-commit
     subjects since the previous tag into Features / Bug fixes /
     Performance / Refactoring / Documentation / Build & CI /
     Chores / Other, with a "Full changelog" link.
  6. Creates the GitHub Release with those notes (or updates the
     notes on a pre-existing release).
  7. Smoke-tests the published crate (`cargo install raysense
     --version <X>` plus a downstream `cargo check`).

Bug fixes vs the prior workflow:
  - `version_of` previously read from `crates/raysense/Cargo.toml`,
    which never existed in the single-crate layout. Now reads from
    the root Cargo.toml.
  - Trigger was `release: published`, which required hand-creating
    the GitHub Release before any automation could run. Now the
    tag IS the trigger, and the release is created automatically
    with auto-generated notes.

Manual dry-run path kept via `workflow_dispatch` with
`dry_run: true` (default) -- runs `cargo package` + `cargo publish
--dry-run` and skips release creation and smoke test.

Permissions: workflow now declares `contents: write` so the
GITHUB_TOKEN can call `gh release create` / `gh release edit`.

Prerequisite for the next real release: `CARGO_REGISTRY_TOKEN`
secret must be set on the repo (it was already referenced by the
prior workflow).
@singaraiona singaraiona merged commit 4ae815a into main May 1, 2026
1 check passed
@singaraiona singaraiona deleted the ci/tag-driven-release branch May 1, 2026 15:56
singaraiona added a commit that referenced this pull request May 1, 2026
The CI vendor step clones rayforce into vendor/rayforce/ at run
time, but vendor/ is gitignored (the source of truth lives in
upstream rayforce + .rayforce-version, not the committed tree).
cargo package would otherwise refuse to ship what it sees as
'uncommitted changes' from those untracked files.

Caught by the dry-run dispatch on PR #12's merge commit; the
workflow exited with status 101 listing every vendor/rayforce/
file as untracked.

Co-authored-by: Anton <anton.kundenko@gmail.com>
singaraiona added a commit that referenced this pull request May 1, 2026
Rewrite publish.yml to be triggered by `vX.Y.Z` tag pushes (or a
manual dispatch for dry-run). On a real release tag, the workflow:

  1. Verifies the tag matches Cargo.toml's version field, fails
     loudly if they drift.
  2. Vendors rayforce at the pinned SHA (existing behavior).
  3. Runs `cargo test`.
  4. Publishes to crates.io, idempotent (skips if the version is
     already there).
  5. Generates release notes by grouping conventional-commit
     subjects since the previous tag into Features / Bug fixes /
     Performance / Refactoring / Documentation / Build & CI /
     Chores / Other, with a "Full changelog" link.
  6. Creates the GitHub Release with those notes (or updates the
     notes on a pre-existing release).
  7. Smoke-tests the published crate (`cargo install raysense
     --version <X>` plus a downstream `cargo check`).

Bug fixes vs the prior workflow:
  - `version_of` previously read from `crates/raysense/Cargo.toml`,
    which never existed in the single-crate layout. Now reads from
    the root Cargo.toml.
  - Trigger was `release: published`, which required hand-creating
    the GitHub Release before any automation could run. Now the
    tag IS the trigger, and the release is created automatically
    with auto-generated notes.

Manual dry-run path kept via `workflow_dispatch` with
`dry_run: true` (default) -- runs `cargo package` + `cargo publish
--dry-run` and skips release creation and smoke test.

Permissions: workflow now declares `contents: write` so the
GITHUB_TOKEN can call `gh release create` / `gh release edit`.

Prerequisite for the next real release: `CARGO_REGISTRY_TOKEN`
secret must be set on the repo (it was already referenced by the
prior workflow).

Co-authored-by: Anton <anton.kundenko@gmail.com>
singaraiona added a commit that referenced this pull request May 1, 2026
The CI vendor step clones rayforce into vendor/rayforce/ at run
time, but vendor/ is gitignored (the source of truth lives in
upstream rayforce + .rayforce-version, not the committed tree).
cargo package would otherwise refuse to ship what it sees as
'uncommitted changes' from those untracked files.

Caught by the dry-run dispatch on PR #12's merge commit; the
workflow exited with status 101 listing every vendor/rayforce/
file as untracked.

Co-authored-by: Anton <anton.kundenko@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant