Releases & CI/CD Guide
May 25, 2025 ยท View on GitHub
This project contains both a Rust CLI and a VS Code extension. Release automation is managed via GitHub Actions for both components. This guide explains how to build, test, and release both parts of the project.
Overview
- Rust CLI: Source in
src/, tested and released via Cargo and GitHub Actions. - VS Code Extension: Source in
vscode-extension/, tested and released via npm and GitHub Actions. - Workflows: All workflows are in
.github/workflows/.
Rust CLI
Workflows
- cli-ci.yml: Lints, builds, tests, and runs security audits on the Rust code on push/PR.
- cli-release.yml: Builds binaries for all platforms and creates a GitHub Release when you push a tag like
vX.Y.Z(excludesvscode-v*tags).
Testing
-
Run all tests:
cargo test -
Run a specific test:
cargo test <test_name>
Release
-
Update
Cargo.tomlwith the new version. -
Update
CHANGELOG.md. -
Tag and push:
git tag vX.Y.Z git push origin vX.Y.Z -
The release workflow will build binaries and upload them to GitHub Releases.
VS Code Extension
Workflows
- extension-ci.yml: Lints, builds, and tests the extension on push/PR, runs cross-platform tests on PRs.
- extension-release.yml: Packages the extension and uploads
.vsixto GitHub Releases onvscode-vX.Y.Ztags, includes manual publishing instructions for both VS Code Marketplace and Open VSX Registry.
Testing
-
Run all tests:
cd vscode-extension npm install npm test
Release
-
Update
vscode-extension/package.jsonwith the new version. -
Update
vscode-extension/CHANGELOG.md. -
Tag and push:
git tag vscode-vX.Y.Z git push origin vscode-vX.Y.Z -
The publish workflow will build, test, and upload the
.vsixto GitHub Releases. -
Manual Marketplace Publishing:
-
To publish to the VS Code Marketplace:
cd vscode-extension npx vsce publish -
To publish to Open VSX Registry:
cd vscode-extension npx ovsx publish -
Requires
VSCE_PATandOVSX_PATsecrets/tokens respectively.
-
Local Workflow Testing
-
Use act to run workflows locally in Docker.
-
Example (from project root):
act push -W .github/workflows/extension-ci.yml --container-architecture linux/amd64 act push -W .github/workflows/cli-ci.yml --container-architecture linux/amd64 -
See
.actrcfor recommended settings (especially for Apple Silicon).
Required Secrets
- Rust CLI:
CRATES_IO_TOKEN(for publishing to crates.io, if enabled)
- VS Code Extension:
VSCE_PAT(for publishing to VS Code Marketplace)OVSX_PAT(for publishing to Open VSX Registry)GITHUB_TOKEN(provided by GitHub Actions)
File Structure
.github/
workflows/ # All workflow YAML files
src/ # Rust CLI source
vscode-extension/ # VS Code extension source, tests, and package.json
CI-CD.md # (This file, if you want to keep a copy here)
README.md # User-facing extension docs
package.json # Extension manifest
...
Troubleshooting
- Workflow fails on install:
- Make sure
package-lock.jsonis in sync withpackage.json(runnpm installafter any dependency change).
- Make sure
- Node version consistency:
- All workflows now use Node 20 for consistency and latest features.
- Tests not found:
- Ensure test files are compiled to
out/*.test.jsin the extension.
- Ensure test files are compiled to
- Release not uploaded:
- Make sure you pushed a tag matching the required pattern (
vX.Y.Zfor Rust,vscode-vX.Y.Zfor the extension).
- Make sure you pushed a tag matching the required pattern (
- Manual publishing fails:
- Ensure you have the correct tokens and are in the
vscode-extensiondirectory.
- Ensure you have the correct tokens and are in the
More
- See CONTRIBUTING.md for contribution guidelines.
- See vscode-extension/README.md for extension usage.