Add release workflow for crates.io publishing#21
Conversation
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
There was a problem hiding this comment.
Pull request overview
This PR adds a GitHub Actions workflow to automate publishing Rust crates to crates.io when version tags are pushed. The workflow includes testing, GitHub release creation, and authenticated publishing to crates.io using OIDC token authentication.
Key changes:
- Automated testing triggered on version tags
- GitHub release creation with support for pre-releases
- Secure crates.io publishing using OIDC authentication
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: env | ||
|
|
||
| - name: Fetch sources | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
There was a problem hiding this comment.
Would rather wait for dependabot to fix.
| run: | | ||
| set -ux | ||
| extra_opts= | ||
| if echo "$REF_NAME" | grep -- -; then extra_opts=" --prerelease"; fi |
There was a problem hiding this comment.
The grep command on line 51 will succeed if a hyphen appears anywhere in the tag name, not just in pre-release identifiers (e.g., 'v1.0-alpha', but also 'my-project-v1.0'). Consider using a more precise pattern like grep -E '-(alpha|beta|rc)' or checking the semantic version format more strictly.
| if echo "$REF_NAME" | grep -- -; then extra_opts=" --prerelease"; fi | |
| if echo "$REF_NAME" | grep -E -- '-(alpha|beta|rc)'; then extra_opts=" --prerelease"; fi |
There was a problem hiding this comment.
This is copied from repo-config, I'm sure it is fine.
No description provided.