Skip to content

ci: trigger crates.io publish on GitHub Release instead of tag push#23

Merged
tbille merged 1 commit into
mainfrom
ci/release-on-publish
Apr 28, 2026
Merged

ci: trigger crates.io publish on GitHub Release instead of tag push#23
tbille merged 1 commit into
mainfrom
ci/release-on-publish

Conversation

@tbille
Copy link
Copy Markdown
Member

@tbille tbille commented Apr 28, 2026

Summary

  • Changes the release workflow trigger from tag push (v*) to GitHub Release publish event
  • Removes the github-release job (no longer needed since the release already exists when the workflow runs)
  • Updates version tag extraction to use github.event.release.tag_name instead of GITHUB_REF

Motivation

Publishing to crates.io should be triggered by creating a GitHub Release, not by pushing a tag directly. This makes the release the single source of truth and gives better control over the publish process (e.g., draft releases won't trigger a publish).

Release workflow after this change

  1. Bump the version in Cargo.toml and merge to main
  2. Create a GitHub Release (via UI or gh release create v0.1.0)
  3. The workflow triggers automatically, verifies the version matches the tag, runs tests, and publishes to crates.io

Prerequisites for first publish

The CARGO_REGISTRY_TOKEN secret must be configured in the repository settings with a valid crates.io API token.

@tbille tbille merged commit 9a581ae into main Apr 28, 2026
7 checks passed
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