-
Notifications
You must be signed in to change notification settings - Fork 0
Add GitHub Actions workflow for VSCode extension publishing #116
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
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
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.
Pull request overview
This PR implements a complete automated publishing pipeline for the ObjectQL VSCode extension to the Visual Studio Code Marketplace. It adds GitHub Actions workflow automation, necessary marketplace requirements (PNG icon, LICENSE file), and comprehensive documentation for maintainers.
Changes:
- Added GitHub Actions workflow with manual dispatch and tag-based triggers for extension publishing
- Generated PNG icon from SVG and updated package.json to reference it
- Added LICENSE file and comprehensive PUBLISHING.md documentation
- Updated .vscodeignore to exclude build artifacts and internal documentation
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/publish-vscode-extension.yml |
New workflow for building, packaging, and publishing the VSCode extension to marketplace |
.github/WORKFLOWS.md |
Documents the new publish-vscode-extension workflow |
packages/tools/vscode-objectql/package.json |
Added icon field pointing to PNG file |
packages/tools/vscode-objectql/images/icon.png |
Generated 128x128 PNG icon for marketplace |
packages/tools/vscode-objectql/images/icon.png.placeholder |
Removed placeholder file (no longer needed) |
packages/tools/vscode-objectql/images/icon-generation.md |
Removed generation guide (icon now exists) |
packages/tools/vscode-objectql/README.md |
Updated icon reference from SVG to PNG, added publishing section |
packages/tools/vscode-objectql/PUBLISHING.md |
Comprehensive guide for publishing the extension |
packages/tools/vscode-objectql/LICENSE |
MIT license file required for marketplace |
packages/tools/vscode-objectql/.vscodeignore |
Updated to exclude tsconfig.tsbuildinfo and internal docs |
| issues: write | ||
| pull-requests: write | ||
|
|
Copilot
AI
Jan 17, 2026
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.
The workflow permissions include 'issues: write' and 'pull-requests: write', but the workflow does not interact with issues or pull requests. These permissions should be removed to follow the principle of least privilege. Only 'contents: write' is needed for creating releases.
| issues: write | |
| pull-requests: write |
| working-directory: packages/tools/vscode-objectql | ||
| run: | | ||
| npx @vscode/vsce package --no-yarn | ||
| echo "VSIX_FILE=$(ls *.vsix)" >> $GITHUB_ENV |
Copilot
AI
Jan 17, 2026
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.
Using 'ls *.vsix' to capture the filename can fail if multiple .vsix files exist in the directory. Consider using a more robust approach such as specifying the exact filename based on the package.json name and version, or using 'ls -1 *.vsix | head -n 1' to ensure only one file is captured.
| echo "VSIX_FILE=$(ls *.vsix)" >> $GITHUB_ENV | |
| echo "VSIX_FILE=$(ls -1 *.vsix | head -n 1)" >> $GITHUB_ENV |
| echo "Updating version to ${{ inputs.version }}" | ||
| npm version ${{ inputs.version }} --no-git-tag-version | ||
|
|
Copilot
AI
Jan 17, 2026
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.
The version input is not validated before being passed to 'npm version'. If a user provides an invalid version string, the command will fail. Consider adding validation to ensure the version follows semantic versioning format (e.g., X.Y.Z) or is one of the npm version keywords (patch, minor, major, prepatch, preminor, premajor, prerelease).
| echo "Updating version to ${{ inputs.version }}" | |
| npm version ${{ inputs.version }} --no-git-tag-version | |
| VERSION="${{ inputs.version }}" | |
| # Allow npm version keywords and semantic version strings (X.Y.Z with optional pre-release/build) | |
| if [[ "$VERSION" == "patch" || "$VERSION" == "minor" || "$VERSION" == "major" || \ | |
| "$VERSION" == "prepatch" || "$VERSION" == "preminor" || "$VERSION" == "premajor" || \ | |
| "$VERSION" == "prerelease" ]]; then | |
| echo "Updating version using npm keyword: $VERSION" | |
| elif [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then | |
| echo "Updating version to semantic version: $VERSION" | |
| else | |
| echo "::error::Invalid version input '$VERSION'. Expected a semantic version (e.g., 1.2.3) or one of: patch, minor, major, prepatch, preminor, premajor, prerelease." | |
| exit 1 | |
| fi | |
| npm version "$VERSION" --no-git-tag-version |
| echo "::error::VSCE_PAT secret is not set. Cannot publish to marketplace." | ||
| exit 1 | ||
| fi | ||
| npx @vscode/vsce publish --no-yarn --pat "$VSCE_PAT" |
Copilot
AI
Jan 17, 2026
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.
The VSCE_PAT secret is properly quoted when passed to the vsce command, which is good for security. However, consider using the environment variable approach instead of passing it via command line argument. The vsce tool automatically reads from the VSCE_PAT environment variable, so you could simplify line 100 to just 'npx @vscode/vsce publish --no-yarn' and rely on the env block on line 94.
| npx @vscode/vsce publish --no-yarn --pat "$VSCE_PAT" | |
| npx @vscode/vsce publish --no-yarn |
Implements automated publishing pipeline for the ObjectQL VSCode extension to the Visual Studio Code Marketplace.
Workflow Features
Trigger Methods:
vscode-v*.*.*Pipeline:
.vsixusing@vscode/vsceVSCE_PATsecret)Extension Fixes
iconfield to package.json.vscodeignoreto exclude build artifacts (tsconfig.tsbuildinfo, CONTRIBUTING.md)Usage
Manual publish:
# GitHub Actions UI → Run workflow → Configure optionsTag-based publish:
Setup: Repository admin must add
VSCE_PATsecret with VSCode Marketplace Personal Access Token (Marketplace: Manage scope).See
packages/tools/vscode-objectql/PUBLISHING.mdfor PAT generation and detailed instructions.Original prompt
💡 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.