-
Notifications
You must be signed in to change notification settings - Fork 278
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(workflows): add script for full release of alpha test package #2785
Conversation
WalkthroughThis pull request introduces a new GitHub Actions workflow for manually dispatching and publishing alpha versions of components. The workflow, named "Dispatch All Publish Alpha", allows triggering a release process with a specific version input. It includes steps for parsing the version, checking out code, setting up the development environment (pnpm and Node.js), installing dependencies, building components, and publishing Vue2 and Vue3 components. Additionally, a new CLI command and script have been added to support the alpha release process. Changes
Sequence DiagramsequenceDiagram
participant User
participant GitHub Actions
participant CLI
participant Build System
participant NPM Registry
User->>GitHub Actions: Trigger workflow_dispatch
GitHub Actions->>GitHub Actions: Validate version input
GitHub Actions->>GitHub Actions: Checkout code
GitHub Actions->>GitHub Actions: Setup pnpm and Node.js
GitHub Actions->>CLI: Run release:alpha
CLI->>Build System: Build components
Build System->>CLI: Return build artifacts
CLI->>NPM Registry: Publish components
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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
CodeRabbit Configuration File (
|
WalkthroughThis PR introduces a script for the full release of an alpha test package. It includes changes to the CI workflow, adds a new command for releasing alpha packages, and updates the package.json to include the new release script. Changes
|
[e2e-test-warn] The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug". Please make sure you've read our contributing guide |
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: 3
🧹 Nitpick comments (4)
internals/cli/src/commands/release/releaseAlpha.ts (1)
5-5
: Consider making excludeFiles configurableThe
excludeFiles
array could be moved to a configuration file or accepted as a parameter to make the function more flexible and maintainable.internals/cli/src/index.ts (1)
12-12
: Consider internationalization for command descriptionsThe command description is currently in Chinese. Consider using a localization system to support multiple languages, or provide descriptions in both Chinese and English.
.github/workflows/dispatch-all-publish-alpha.yml (1)
25-25
: Update GitHub Actions to latest versionsThe following actions are using older versions:
- actions/github-script@v6
- actions/setup-node@v3
- actions/cache@v3
Consider updating to the latest versions for security and feature improvements.
Also applies to: 44-44, 54-54
🧰 Tools
🪛 actionlint (1.7.4)
25-25: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
package.json (1)
76-76
: Consider adding documentation for the alpha release process.Since this is introducing a new release type, it would be helpful to document the alpha release process.
Consider:
- Adding a comment above the script explaining its purpose (similar to other commented sections)
- Updating the repository's documentation to include the alpha release process
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/dispatch-all-publish-alpha.yml
(1 hunks)internals/cli/package.json
(1 hunks)internals/cli/src/commands/release/releaseAlpha.ts
(1 hunks)internals/cli/src/index.ts
(1 hunks)package.json
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/dispatch-all-publish-alpha.yml
25-25: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
44-44: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
54-54: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🔇 Additional comments (3)
internals/cli/src/commands/release/releaseAlpha.ts (1)
26-31
: Consider making distLists configurableThe
distLists
array contains hardcoded paths. Consider moving this to a configuration file to improve maintainability.Also, verify that these paths exist before processing:
internals/cli/package.json (1)
24-24
: LGTM!The script follows the established pattern and correctly uses esno for TypeScript execution.
package.json (1)
76-76
: LGTM! Verify the referenced script exists.The new alpha release script follows the project's established patterns for release commands.
Let's verify that the referenced script exists in the CLI package:
✅ Verification successful
✓ Verified: The release:alpha script is properly implemented
The script exists in the CLI package and is correctly integrated into the command-line interface, following the same patterns as other release commands.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check if the release:alpha script exists in the internals/cli package.json # Look for the script definition rg '"release:alpha":\s*"[^"]*"' internals/cli/package.json # Also check for the implementation file that might be referenced fd -t f 'release-alpha' internals/cli/Length of output: 155
Script:
#!/bin/bash # Check if src/index.ts exists and look for release:alpha handling rg -A 5 'release:alpha' internals/cli/src/ --type ts # Also check the main entry point cat internals/cli/src/index.tsLength of output: 2857
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: 4
♻️ Duplicate comments (2)
.github/workflows/dispatch-all-publish-alpha.yml (2)
29-31
:⚠️ Potential issueFix critical typo in version validation and translate error message
The version validation has critical issues:
- There's a typo in the variable name (
vserion
should beversion
)- The error message should be in English for better accessibility
-if(!/^\d\.\d+\.\d+/.test(vserion)) { - throw new Error('版本号格式不正确') +if(!/^\d\.\d+\.\d+/.test(version)) { + throw new Error('Invalid version format')
51-52
:⚠️ Potential issueFix potential Windows path issues
The GITHUB_OUTPUT command needs to be adjusted for Windows compatibility.
-echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT +echo "pnpm_cache_dir=$(pnpm store path)" >> "$GITHUB_OUTPUT"
🧹 Nitpick comments (2)
.github/workflows/dispatch-all-publish-alpha.yml (2)
8-11
: Translate version input description to EnglishConsider translating the version description to English to improve accessibility for international contributors:
- 输入您将要发布的版本号, - 例如: `3.xx.xx`. + Enter the version number to be published, + for example: `3.xx.xx`.
19-19
: Consider using Ubuntu runner instead of WindowsRunning CI/CD workflows on Windows can lead to path-related issues and slower execution times. Consider using
ubuntu-latest
for better compatibility and performance.- runs-on: windows-latest + runs-on: ubuntu-latest
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/dispatch-all-publish-alpha.yml
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/dispatch-all-publish-alpha.yml
25-25: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
44-44: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
54-54: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
PR
增加全量发布alpha测试包的脚本
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
@opentinyvue
organization.Chores