Skip to content

Release to Visual Studio Code Extension Marketplace #29

Release to Visual Studio Code Extension Marketplace

Release to Visual Studio Code Extension Marketplace #29

Workflow file for this run

name: release to visual studio code extension marketplace
on:
release:
types:
- prereleased
- published
jobs:
package:
name: package vscode extension
runs-on: ubuntu-latest
steps:
- name: checkout extension repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup nodejs
uses: actions/setup-node@v4
with:
node-version: 22
- name: npm install
run: npm install
- name: compile
shell: bash
run: |
npm run compile && npm run compile-web
- name: package preview extension
shell: bash
if: 'github.event.prerelease'
run: npx vsce package --pre-release
- name: package release extension
shell: bash
if: '!github.event.prerelease'
run: npx vsce package
- name: upload
uses: actions/upload-artifact@v4
with:
name: packages
path: "*.vsix"
overwrite: true
release:
name: publish vscode extension to the marketplace
runs-on: ubuntu-latest
needs: package
if: success() && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
name: packages
- run: npx vsce publish --packagePath $(find . -iname '*.vsix')
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}