name: Publish VS Code Extension

on:
  release:
    types: [published]

jobs:
  publish-vscode:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: vscode
    steps:
      - uses: actions/checkout@v7

      - uses: actions/setup-node@v6
        with:
          node-version: 22
          registry-url: https://registry.npmjs.org

      - name: Install vsce
        run: npm install -g @vscode/vsce

      - name: Publish to Visual Studio Marketplace
        run: vsce publish -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
