Skip to content
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

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

zzcr
Copy link
Member

@zzcr zzcr commented Jan 13, 2025

PR

增加全量发布alpha测试包的脚本

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Added a new GitHub Actions workflow for manually dispatching alpha releases.
    • Introduced a CLI command for converting packages to the @opentinyvue organization.
    • Created a new release process for alpha versions.
  • Chores

    • Updated project scripts to support the alpha release workflow.
    • Enhanced CLI tooling for release management.

Copy link

coderabbitai bot commented Jan 13, 2025

Walkthrough

This 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

File Change Summary
.github/workflows/dispatch-all-publish-alpha.yml New workflow file for manually dispatching and publishing alpha versions
internals/cli/package.json Added release:alpha script
internals/cli/src/commands/release/releaseAlpha.ts New releaseAlpha function for processing and modifying package files
internals/cli/src/index.ts Added release:alpha command to CLI
package.json Added release:alpha script to trigger CLI alpha release

Sequence Diagram

sequenceDiagram
    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
Loading

Possibly related PRs

Suggested labels

ci, enhancement

Suggested reviewers

  • kagol

Poem

🐰 A rabbit's release, alpha and bright,
Workflows dancing with digital might,
Pnpm spinning, components take flight,
From CLI's magic to publish's delight,
Version numbers gleaming, oh so right! 🚀


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Walkthrough

This 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

File Summary
.github/workflows/dispatch-all-publish-alpha.yml Added a new workflow for dispatching the full release of alpha packages.
internals/cli/package.json Updated to include the new release:alpha command.
internals/cli/src/commands/release/releaseAlpha.ts New script to handle the release of alpha packages by modifying package paths and contents.
internals/cli/src/index.ts Integrated the new releaseAlpha command into the CLI.
package.json Added a new script command for releasing alpha packages.

Copy link

[e2e-test-warn]
The component to be tested is missing.

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

Copy link

@coderabbitai coderabbitai bot left a 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 configurable

The 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 descriptions

The 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 versions

The 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:

  1. Adding a comment above the script explaining its purpose (similar to other commented sections)
  2. Updating the repository's documentation to include the alpha release process
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e1de0b3 and ffbf70e.

📒 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 configurable

The 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.ts

Length of output: 2857

Copy link

@coderabbitai coderabbitai bot left a 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 issue

Fix critical typo in version validation and translate error message

The version validation has critical issues:

  1. There's a typo in the variable name (vserion should be version)
  2. 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 issue

Fix 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 English

Consider 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 Windows

Running 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

📥 Commits

Reviewing files that changed from the base of the PR and between ffbf70e and 1e98939.

📒 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)

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.

1 participant