Skip to content

Release to Visual Studio Code Extension Marketplace #36

Release to Visual Studio Code Extension Marketplace

Release to Visual Studio Code Extension Marketplace #36

Workflow file for this run

name: Release to Visual Studio Code Extension Marketplace
on:
release:
types:
- published
jobs:
package:
name: Package Vscode Extension
runs-on: ubuntu-latest
steps:
- name: checkout extension repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- 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.release.prerelease"
run: npx vsce package --pre-release
- name: package release extension
shell: bash
if: "!github.event.release.prerelease"
run: npx vsce package
- name: upload
uses: actions/upload-artifact@v4
with:
name: packages
path: "*.vsix"
overwrite: true
release:
name: Publish 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 --pre-release --packagePath $(find . -iname '*.vsix')
if: "github.event.release.prerelease"
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- run: npx vsce publish --packagePath $(find . -iname '*.vsix')
if: "!github.event.release.prerelease"
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}