-
Notifications
You must be signed in to change notification settings - Fork 2
chore: auto release on github action #4
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
Conversation
WalkthroughThe changes introduce updates to CI/CD workflows and documentation. The Node.js workflow now triggers on both master and main branches. Two new GitHub Actions workflows were created: one for package building and publishing, and another for handling releases using a reusable workflow. Additional modifications include an updated LICENSE copyright statement, revised URLs in the README for repository assets, and updates to the package metadata in package.json. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHub
participant Checkout
participant Build
participant Publish
Developer->>GitHub: Push/Pull Request Event
GitHub->>Checkout: Trigger pkg.pr.new.yml workflow (checkout code)
Checkout-->>GitHub: Code checked out
GitHub->>Build: Enable Corepack, setup Node.js, and run npm install
Build->>GitHub: Build project (npm run prepublishOnly)
GitHub->>Publish: Execute publish command (npx pkg-pr-new publish)
Publish-->>GitHub: Package published
sequenceDiagram
participant Developer
participant GitHub
participant ReleaseJob
participant ReusableWorkflow
Developer->>GitHub: Push Event on master/main branch
GitHub->>ReleaseJob: Trigger release workflow (release.yml)
ReleaseJob->>ReusableWorkflow: Invoke node-release.yml workflow
ReusableWorkflow-->>ReleaseJob: Process release with NPM_TOKEN and GIT_TOKEN
ReleaseJob-->>GitHub: Complete release process
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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
CodeRabbit Configuration File (
|
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.
PR Overview
This PR introduces new GitHub Actions workflows for publishing commits and releasing packages, along with updates to the CI workflow and README badge URLs to support auto release functionality.
- Added a new workflow file (.github/workflows/pkg.pr.new.yml) to publish on any commit.
- Created a release workflow (.github/workflows/release.yml) that leverages an external node-release YAML.
- Updated README.md links for codecov and contributors, and expanded branch support in the CI workflow (.github/workflows/nodejs.yml).
Reviewed Changes
| File | Description |
|---|---|
| .github/workflows/pkg.pr.new.yml | New workflow for publishing any commit |
| .github/workflows/release.yml | New release workflow using eggjs-community's node-release action |
| README.md | Updated codecov and contributors badge URLs |
| .github/workflows/nodejs.yml | Added 'main' branch support alongside 'master' to CI triggers |
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
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/pkg.pr.new.yml (1)
20-23: Publish Step: Consider Adding a Descriptive Name.
While the publish command (npx pkg-pr-new publish) is correctly placed, adding a clear step name (e.g., "Publish Package") could improve the readability of workflow logs and help with debugging in case of failures.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/workflows/nodejs.yml(1 hunks).github/workflows/pkg.pr.new.yml(1 hunks).github/workflows/release.yml(1 hunks)LICENSE(1 hunks)README.md(2 hunks)package.json(2 hunks)
✅ Files skipped from review due to trivial changes (3)
- README.md
- .github/workflows/release.yml
- LICENSE
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: build
- GitHub Check: Node.js / Test (windows-latest, 20)
- GitHub Check: Node.js / Test (windows-latest, 22)
- GitHub Check: Node.js / Test (windows-latest, 18)
🔇 Additional comments (6)
.github/workflows/nodejs.yml (1)
5-7: Update CI Branch Triggers.
The push and pull_request events now include both "master" and "main" branches. This change improves flexibility and ensures the workflows run on the correct set of branches according to your branching strategy..github/workflows/pkg.pr.new.yml (3)
1-3: New Workflow File: Publish Any Commit.
This new workflow is clearly defined to trigger on both push and pull_request events. The descriptive name and minimal trigger configuration are appropriate for a package publishing automation.
8-16: Workflow Steps: Corepack and Node.js Setup.
The steps to enable Corepack and configure Node.js using the latest setup action (actions/setup-node@v4 with node version 20) are well ordered and meet the requirements for building the project.
17-19: Install Dependencies Step.
Executing "npm install" to install the dependencies is straightforward and correctly configured.package.json (2)
2-3: Package Metadata Update: Name and Version.
The package name has been updated from "egg-typebox-validate-fengmk2" to "egg-typebox-validate" and the version changed to "2.3.1". These updates reflect a move to a simplified naming convention and a stable release version.
22-24: Repository URL Update.
The repository URL has been updated to "https://github.com/eggjs-community/egg-typebox-validate.git", which aligns with the new organization ownership. This ensures that external references (such as documentation and CI links) point to the correct repository location.
Summary by CodeRabbit