-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: publish to npm workflow #456
Conversation
📝 WalkthroughWalkthroughThe pull request modifies the GitHub Actions workflow for publishing to NPM. The workflow now triggers automatically on release publication instead of manual dispatch. The version and NPM tag determination process has been updated to use GitHub reference information directly, removing the need for manual input. The publish command now extracts the version from the tag reference and uses the dynamically determined NPM tag. Changes
Sequence DiagramsequenceDiagram
participant GitHub as GitHub Release
participant Workflow as Publish Workflow
participant NPM as NPM Registry
GitHub->>Workflow: Trigger on release published
Workflow->>Workflow: Extract version from tag
Workflow->>Workflow: Determine NPM tag
Workflow->>NPM: Publish package
NPM-->>Workflow: Publish confirmation
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #456 +/- ##
=======================================
Coverage 87.07% 87.07%
=======================================
Files 9 9
Lines 526 526
Branches 128 128
=======================================
Hits 458 458
Misses 68 68 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/publish-npm.yaml (1)
35-42
: LGTM! Consider adding error handling.The version tag extraction logic is solid and follows best practices. Consider adding validation to ensure the ref is a valid version tag.
VERSION_TAG=${GITHUB_REF#refs/tags/v} +if [[ ! $VERSION_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$ ]]; then + echo "Error: Invalid version tag format" + exit 1 +fi if [[ $VERSION_TAG == *"-"* ]]; then
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/publish-npm.yaml
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: generate
- GitHub Check: test
- GitHub Check: slither
- GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
.github/workflows/publish-npm.yaml (3)
4-5
: LGTM! Good automation improvement.Triggering on release publication is a better approach than manual workflow dispatch as it:
- Ensures synchronization between GitHub releases and NPM versions
- Reduces human error in version specification
- Automates the publishing process
45-48
: LGTM! Robust publish command configuration.The publish command is well structured:
- Uses version from GitHub release tag
- References NPM tag from previous step output
- Correctly avoids creating duplicate git tags
23-23
: Verify Foundry toolchain requirement.Please confirm if Foundry is required for the NPM package build process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Publish to npm when making a GitHub release.
Summary by CodeRabbit