Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

The release workflow now distinguishes between stable releases, pre-releases, and non-release tags using regex patterns, validates version consistency with package.json, and publishes to VS Code Marketplace with appropriate flags.

Tag Validation & Routing

  • Stable releases (/^[0-9]+\.[0-9]+\.[0-9]+$/): Publish as stable to marketplace + create GitHub release
  • Pre-releases (/^[0-9]+\.[0-9]+\.[0-9]+-.+$/): Publish with --pre-release flag + create pre-release on GitHub
  • Non-release tags (anything else): Build and test only, no publishing

Version Consistency

Extracts numeric version from tag and compares with package.json. Workflow fails if mismatch detected:

# Tag: 1.0.3-beta → Extracted: 1.0.3
# Must match package.json "version": "1.0.3"

Marketplace Publishing

  • Uses MS_STORE_TOKEN secret via environment variable
  • Publishes with vsce publish (stable) or vsce publish --pre-release (pre-release)
  • GitHub release only created after successful marketplace publish

Documentation

Added RELEASE_WORKFLOW.md with tag format specifications, release procedures, and troubleshooting guide.

Original prompt

帮我改进 workflow 发布流程:

  1. release 发布的tag 只在匹配到 /^\d+.\d+.\d+$/ 正则规则的正式 tag 才触发. 当 tag 不符合规则时, 仅执行编译测试等, 不发布制品。
  2. 支持 pre-release 发布, pre-replease 的 tag 规则使用 /^\d+.\d+.\d+-.+$/ 的形式, 后缀可以是 -alpha、 -beta、-rc 等具体值。如果匹配到, 那么认为是 pre-release 发布。需要注意, 由于 vscode 商店并不支持插件的实际发布版本带类似的后缀, 所以这里的 pre-release 版本仅仅是 tag 名字。实际的版本号还是前面的数字版本。
  3. 不管是那种 release, 都要检查 tag 的版本号是否跟代码里面 package.json 里面的版本是否实际一致, 如果不一致, 请报错。
  4. 我已经在商店配置可用于发布的 ms 商店的 token, 名字是 MS_STORE_TOKEN。 当有成功的发布打包出制品之后, 执行商店的发布, 注意, 商店的发布也遵循正式 release 和 pre-release 两种方式, 使用 pre-release 形式的 tag 触发的情况下, 应该发布预览包。
  5. 如果商店发布失败, 那么 workflow 也失败。 如果商店发布成功, 请同时将打包出来的产物文件发布到项目的 release 页面, 并更新好对应的说明

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link

coderabbitai bot commented Dec 11, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 2 commits December 11, 2025 07:36
…arketplace publishing

Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve workflow release process with version validation Implement tag-based release workflow with marketplace publishing Dec 11, 2025
Copilot AI requested a review from wysaid December 11, 2025 07:42
@wysaid wysaid marked this pull request as ready for review December 14, 2025 14:42
Copilot AI review requested due to automatic review settings December 14, 2025 14:42
@wysaid wysaid merged commit 5b30193 into master Dec 14, 2025
9 checks passed
@wysaid wysaid deleted the copilot/improve-workflow-release-process branch December 14, 2025 14:42
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 implements a comprehensive tag-based release workflow that automates VS Code Marketplace publishing and GitHub releases. The workflow uses regex patterns to distinguish between stable releases (X.Y.Z), pre-releases (X.Y.Z-suffix), and non-release tags, validating version consistency with package.json before publishing.

Key Changes:

  • Tag pattern validation with conditional publishing logic (stable vs pre-release vs build-only)
  • Version consistency check between git tags and package.json
  • Marketplace publishing with appropriate flags based on release type

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/release.yml Implements tag validation, version checking, and conditional marketplace/GitHub publishing with support for stable and pre-release flows
RELEASE_WORKFLOW.md Comprehensive documentation covering tag formats, release procedures, version validation rules, and troubleshooting guidance

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +57 to +71
- name: Check version consistency with package.json
if: steps.validate_tag.outputs.should_publish == 'true'
run: |
TAG_VERSION="${{ steps.extract_version.outputs.version }}"
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "Tag version: $TAG_VERSION"
echo "package.json version: $PACKAGE_VERSION"
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "Error: Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
exit 1
fi
echo "Version check passed: $TAG_VERSION"
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

The version consistency check uses the node command (line 61) but runs before the "Use Node.js" step (line 73-76). This will fail if Node.js is not available in the runner by default. Move the "Use Node.js" and "Install dependencies" steps before the version consistency check, or move the version check after those steps.

Copilot uses AI. Check for mistakes.
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