Skip to content

Publish to VS Code MarketPlace & update Sentry #12

Publish to VS Code MarketPlace & update Sentry

Publish to VS Code MarketPlace & update Sentry #12

Workflow file for this run

name: Publish to VS Code MarketPlace
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Get latest tag
run: |
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install dependencies
run: |
npm ci
npm install -g vsce
- name: Update version in package.json
run: |
jq --arg version "$LATEST_TAG" '.version = $version' package.json > package.tmp.json
mv package.tmp.json package.json
shell: bash
- name: Verify updated package.json
run: cat package.json
- name: Package VS Code Extension
run: vsce package
- name: Upload VSIX artifact
uses: actions/upload-artifact@v4
with:
name: vsce-package
path: "*.vsix"
# - name: Publish to VS Code Marketplace
# env:
# VSCE_PAT: ${{ secrets.VSCE_PAT }}
# run: vsce publish -p $VSCE_PAT
sentry-release:
runs-on: ubuntu-latest
needs: deploy
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_URL: ${{ secrets.SENTRY_URL }}
with:
environment: production
version: "$LATEST_TAG"