Skip to content

Commit 01abb3f

Browse files
committed
docs: move RELEASE_WORKFLOW.md to .github/ and add dry-run mode documentation
- Move RELEASE_WORKFLOW.md to .github/ directory alongside workflows - Add documentation for master branch push (dry-run mode) - Add marketplace version check mechanism details - Update workflow steps to reflect actual implementation (14 steps) - Expand troubleshooting section with more scenarios - Add testing guidance for release process
1 parent ea5e695 commit 01abb3f

1 file changed

Lines changed: 66 additions & 10 deletions

File tree

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,30 @@ This document describes the automated release workflow for the EGE VSCode Plugin
44

55
## Overview
66

7-
The release workflow is triggered when you push a git tag to the repository. The behavior depends on the tag format:
7+
The release workflow can be triggered in two ways:
8+
9+
1. **Tag Push (Production)**: Push a git tag to create an actual release
10+
2. **Master Branch Push (Dry-Run)**: Push to master branch to test the workflow without publishing
11+
12+
### Trigger Types
13+
14+
#### Tag Push
15+
When you push a tag, the workflow behaves based on the tag format:
16+
- Builds, validates, and may publish to marketplace
17+
- Creates GitHub releases for valid release tags
18+
- This is the **production mode**
19+
20+
#### Master Branch Push (Dry-Run)
21+
When you push to the master branch:
22+
- Uses version from `package.json` as the simulated tag
23+
- Builds and tests the extension
24+
- Validates tag format and checks marketplace for version conflicts
25+
- **Does NOT** publish to marketplace
26+
- **Does NOT** create GitHub releases
27+
- Uploads VSIX as a workflow artifact (retained for 30 days)
28+
- Useful for testing the release process before creating a tag
29+
30+
The behavior depends on the tag format (or simulated tag in dry-run):
831

932
### Tag Formats
1033

@@ -50,6 +73,16 @@ For all release tags (both stable and pre-release), the workflow validates that:
5073
- Tag: `1.0.3-alpha` → Must match `package.json` version `1.0.3`
5174
- Tag: `1.0.4` → If `package.json` has `1.0.3`, workflow fails ✗
5275

76+
## Marketplace Version Check
77+
78+
Before publishing, the workflow checks if the version already exists in the VS Code Marketplace:
79+
80+
- **Version exists**: Skips marketplace publish, shows a warning, but continues with GitHub release creation
81+
- **Version doesn't exist**: Proceeds with marketplace publishing
82+
- **Dry-run mode**: If version exists, warns that creating a tag will skip marketplace publish
83+
84+
This prevents errors when accidentally pushing the same version tag twice.
85+
5386
## How to Create a Release
5487

5588
### Stable Release
@@ -99,32 +132,55 @@ The workflow requires the following GitHub secret:
99132

100133
## Workflow Steps
101134

102-
1. **Extract Tag Name** - Gets the tag that triggered the workflow
103-
2. **Validate Tag Format** - Determines if it's stable, pre-release, or non-release
135+
1. **Determine Trigger Type** - Identifies if triggered by tag push or master branch push (dry-run)
136+
2. **Validate Tag Format** - Determines if it's stable, pre-release, or non-release pattern
104137
3. **Extract Version** - Extracts numeric version from tag (for release tags only)
105-
4. **Check Version Consistency** - Validates tag version matches package.json
106-
5. **Setup Node.js** - Installs Node.js environment
138+
4. **Check Version Consistency** - Validates tag version matches package.json (only for actual tags)
139+
5. **Setup Node.js** - Installs Node.js 22.x environment
107140
6. **Install Dependencies** - Runs `npm install`
108-
7. **Build** - Compiles TypeScript to JavaScript
141+
7. **Build** - Compiles TypeScript to JavaScript with `npx tsc`
109142
8. **Install VSCE** - Installs VS Code Extension packaging tool
110143
9. **Build VSIX** - Creates the extension package
111-
10. **Publish to Marketplace** - Publishes to VS Code Marketplace (release tags only)
112-
11. **Create GitHub Release** - Creates GitHub release with VSIX file (release tags only)
144+
10. **Check Marketplace** - Queries VS Code Marketplace API to check if version already exists
145+
11. **Warn on Duplicate (Dry-run)** - In dry-run mode, warns if version already exists
146+
12. **Publish to Marketplace** - Publishes if version doesn't exist and not in dry-run mode
147+
- Uses `--pre-release` flag for pre-release tags
148+
- Skipped if version already exists
149+
- Continues on error to allow GitHub release creation
150+
13. **Upload Artifact (Dry-run)** - Uploads VSIX as artifact with 30-day retention (dry-run only)
151+
14. **Create GitHub Release** - Creates release with VSIX attachment (actual tag push only)
152+
- Marked as pre-release for pre-release tags
153+
- Generates release notes automatically
113154

114155
## Troubleshooting
115156

116157
### Workflow fails with "Version mismatch"
117158
- Ensure the tag version matches the version in `package.json`
118159
- For pre-release tags, only the numeric part needs to match
160+
- Note: This check only runs for actual tag pushes, not dry-run mode
161+
162+
### Marketplace publish is skipped
163+
- The workflow detected that the version already exists in the marketplace
164+
- This is a safety feature to prevent duplicate publishes
165+
- The workflow continues and creates a GitHub release anyway
166+
- To publish a new version, increment the version number in `package.json`
119167

120168
### Marketplace publish fails
121169
- Check that `MS_STORE_TOKEN` secret is correctly configured
122170
- Verify the token has appropriate permissions
123-
- The workflow will fail if marketplace publishing fails
171+
- The workflow uses `continue-on-error`, so GitHub release will still be created
172+
- Check the workflow logs for detailed error messages
124173

125174
### Build or test fails
126-
- The workflow runs for all tags, even non-release tags
175+
- The workflow runs for all tags and master branch pushes
127176
- Fix build or test issues before creating release tags
177+
- Use dry-run mode (push to master) to test before tagging
178+
179+
### Testing the release process
180+
- Push to master branch to trigger dry-run mode
181+
- Review the workflow output for warnings about existing versions
182+
- Check the uploaded artifact to verify VSIX package
183+
- Only create a tag when ready for actual release
128184

129185
## Examples
130186

0 commit comments

Comments
 (0)