Skip to content

Add release workflow for crates.io publishing#21

Merged
shsms merged 1 commit intofrequenz-floss:v0.x.xfrom
shsms:ci-release-workflow
Dec 1, 2025
Merged

Add release workflow for crates.io publishing#21
shsms merged 1 commit intofrequenz-floss:v0.x.xfrom
shsms:ci-release-workflow

Conversation

@shsms
Copy link
Collaborator

@shsms shsms commented Dec 1, 2025

No description provided.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Copilot AI review requested due to automatic review settings December 1, 2025 16:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent checkout action versions used across the workflow. The test job uses @v4 while the publish job uses @v5. Consider standardizing on @v5 throughout for consistency.

Suggested change
uses: actions/checkout@v4
uses: actions/checkout@v5

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would rather wait for dependabot to fix.

run: |
set -ux
extra_opts=
if echo "$REF_NAME" | grep -- -; then extra_opts=" --prerelease"; fi
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
if echo "$REF_NAME" | grep -- -; then extra_opts=" --prerelease"; fi
if echo "$REF_NAME" | grep -E -- '-(alpha|beta|rc)'; then extra_opts=" --prerelease"; fi

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is copied from repo-config, I'm sure it is fine.

@shsms shsms added this pull request to the merge queue Dec 1, 2025
Merged via the queue into frequenz-floss:v0.x.x with commit 1ea273c Dec 1, 2025
9 checks passed
@shsms shsms deleted the ci-release-workflow branch December 1, 2025 16:38
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.

2 participants