|
| 1 | +# VS Code Extension Publishing Setup |
| 2 | + |
| 3 | +This document explains how the automated publishing workflow for the StarlingMonkey VS Code debugger extension works. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The VS Code extension is published automatically to the VS Code Marketplace when changes are merged to the `main` branch that affect files in the `debugger/vscode-dap-extension/` directory. |
| 8 | + |
| 9 | +## Workflow |
| 10 | + |
| 11 | +The publishing process uses two GitHub Actions jobs: |
| 12 | + |
| 13 | +1. **release-please**: Creates or updates a release PR when changes are detected. When this PR is merged, it creates a GitHub release with an appropriate version tag (e.g., `v0.3.0`). |
| 14 | + |
| 15 | +2. **publish-extension**: When a release is created, this job: |
| 16 | + - Builds the extension |
| 17 | + - Packages it as a `.vsix` file |
| 18 | + - Publishes it to the VS Code Marketplace |
| 19 | + - Uploads the `.vsix` file to the GitHub release |
| 20 | + |
| 21 | +## Configuration |
| 22 | + |
| 23 | +### Release Please |
| 24 | + |
| 25 | +The extension is configured as a separate package in the top-level release-please config file. |
| 26 | + |
| 27 | +### Required Secret |
| 28 | + |
| 29 | +To publish to the VS Code Marketplace, a `VSCE_PAT` secret must be configured in the repository settings: |
| 30 | + |
| 31 | +1. Go to https://dev.azure.com |
| 32 | +2. Create a Personal Access Token (PAT) with: |
| 33 | + - Organization: `All accessible organizations` |
| 34 | + - Expiration: Choose an appropriate duration |
| 35 | + - Scopes: Select `Marketplace` > `Manage` |
| 36 | +3. Add this token as a repository secret named `VSCE_PAT` in the GitHub repository settings |
| 37 | + |
| 38 | +### Publisher Account |
| 39 | + |
| 40 | +The extension is published under the `bytecodealliance` publisher account on the VS Code Marketplace. |
| 41 | +Publishing a fork under a different account requires changing the `package.json` file accordingly. |
| 42 | +In that case, make sure to also change the name and update the other metadata to point to your repository, etc. |
| 43 | + |
| 44 | +## Making a Release |
| 45 | + |
| 46 | +To trigger a new release: |
| 47 | + |
| 48 | +1. Make changes to files in `debugger/vscode-dap-extension/` |
| 49 | +2. Use [Conventional Commits](https://www.conventionalcommits.org/) format with the scope `debugger): |
| 50 | + - `feat(debugger):` for new features (bumps minor version) |
| 51 | + - `fix(debugger):` for bug fixes (bumps patch version) |
| 52 | + - `BREAKING CHANGE:` in footer for breaking changes (bumps major version) |
| 53 | + - `chore(debugger):`, `docs(debugger):`, etc. for other changes (no version bump) |
| 54 | +3. Open a PR with your changes |
| 55 | +4. Merge the PR to `main` |
| 56 | +5. Release-please will create/update a release PR |
| 57 | +6. Merge the release PR to trigger publishing |
| 58 | + |
| 59 | +## Version Management |
| 60 | + |
| 61 | +- Current version is tracked in `package.json` |
| 62 | +- Release-please automatically updates the version |
| 63 | +- Tags are prefixed with `v` (e.g., `v0.3.0`) |
| 64 | + |
| 65 | +## Troubleshooting |
| 66 | + |
| 67 | +### Publishing Fails |
| 68 | + |
| 69 | +Check that: |
| 70 | +- The `VSCE_PAT` secret is valid and hasn't expired |
| 71 | +- The publisher account has proper permissions |
| 72 | +- The extension builds successfully locally with `npm run build && npm run package` |
| 73 | + |
| 74 | +### No Release PR Created |
| 75 | + |
| 76 | +Ensure: |
| 77 | +- Changes are in the `debugger/vscode-dap-extension/` directory |
| 78 | +- Commits follow the Conventional Commits format |
0 commit comments