Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/vscode-extension-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This workflow publishes the StarlingMonkey VS Code debugger extension to the VS Code Marketplace.
# It uses release-please to manage versioning and changelog, and only triggers when files
# in the debugger/vscode-dap-extension folder are changed.
#
# Prerequisites:
# - A VSCE_PAT secret must be configured in the repository settings
# (get a Personal Access Token from https://dev.azure.com with Marketplace publisher access)
# - The publisher 'bytecodealliance' must exist in the VS Code Marketplace
# (see https://code.visualstudio.com/api/working-with-extensions/publishing-extension)

name: VS Code Debugger Extension Release

on:
push:
branches:
- main
paths:
- 'debugger/vscode-dap-extension/**'

permissions:
contents: write
issues: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
version: ${{ steps.release.outputs.version }}
steps:
- uses: googleapis/release-please-action@a02a34c4d625f9be7cb89156071d8567266a2445 #v4.2.0
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: debugger/vscode-dap-extension/release-please-config.json
manifest-file: debugger/vscode-dap-extension/.release-please-manifest.json

publish-extension:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #v4.4.0
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
working-directory: debugger/vscode-dap-extension
run: npm ci

- name: Build extension
working-directory: debugger/vscode-dap-extension
run: npm run build

- name: Package extension
working-directory: debugger/vscode-dap-extension
run: npm run package

- name: Publish to VS Code Marketplace
working-directory: debugger/vscode-dap-extension
run: npm run publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

- name: Upload VSIX to Release
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 #2.3.2
with:
tag_name: ${{ needs.release-please.outputs.tag_name }}
files: debugger/vscode-dap-extension/*.vsix
make_latest: false
78 changes: 78 additions & 0 deletions debugger/vscode-dap-extension/PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# VS Code Extension Publishing Setup

This document explains how the automated publishing workflow for the StarlingMonkey VS Code debugger extension works.

## Overview

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.

## Workflow

The publishing process uses two GitHub Actions jobs:

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`).

2. **publish-extension**: When a release is created, this job:
- Builds the extension
- Packages it as a `.vsix` file
- Publishes it to the VS Code Marketplace
- Uploads the `.vsix` file to the GitHub release

## Configuration

### Release Please

The extension is configured as a separate package in the top-level release-please config file.

### Required Secret

To publish to the VS Code Marketplace, a `VSCE_PAT` secret must be configured in the repository settings:

1. Go to https://dev.azure.com
2. Create a Personal Access Token (PAT) with:
- Organization: `All accessible organizations`
- Expiration: Choose an appropriate duration
- Scopes: Select `Marketplace` > `Manage`
3. Add this token as a repository secret named `VSCE_PAT` in the GitHub repository settings

### Publisher Account

The extension is published under the `bytecodealliance` publisher account on the VS Code Marketplace.
Publishing a fork under a different account requires changing the `package.json` file accordingly.
In that case, make sure to also change the name and update the other metadata to point to your repository, etc.

## Making a Release

To trigger a new release:

1. Make changes to files in `debugger/vscode-dap-extension/`
2. Use [Conventional Commits](https://www.conventionalcommits.org/) format with the scope `debugger):
- `feat(debugger):` for new features (bumps minor version)
- `fix(debugger):` for bug fixes (bumps patch version)
- `BREAKING CHANGE:` in footer for breaking changes (bumps major version)
- `chore(debugger):`, `docs(debugger):`, etc. for other changes (no version bump)
3. Open a PR with your changes
4. Merge the PR to `main`
5. Release-please will create/update a release PR
6. Merge the release PR to trigger publishing

## Version Management

- Current version is tracked in `package.json`
- Release-please automatically updates the version
- Tags are prefixed with `v` (e.g., `v0.3.0`)

## Troubleshooting

### Publishing Fails

Check that:
- The `VSCE_PAT` secret is valid and hasn't expired
- The publisher account has proper permissions
- The extension builds successfully locally with `npm run build && npm run package`

### No Release PR Created

Ensure:
- Changes are in the `debugger/vscode-dap-extension/` directory
- Commits follow the Conventional Commits format
6 changes: 6 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
"release-type": "simple",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
"include-v-in-tag": true,
"packages": {
".": {
"exclude-paths": ["debugger/vscode-dap-extension/**"]
},
"debugger/vscode-dap-extension": {
"package-name": "starlingmonkey-debugger",
"release-type": "node",
"include-v-in-tag": true
}
}
Expand Down