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
40 changes: 29 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,42 @@ on:
branches: [main]

jobs:
build:
publish-vscode-marketplace:
runs-on: ubuntu-latest
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20.16.0'
node-version: "20.16.0"

- name: Install dependencies
run: npm ci

- name: Build extension
run: npm run build

# Only run publish step when pushing to main (not on PRs)
- name: Publish to VS Code Marketplace
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
npm ci
# Extract version from package.json to use in the vsix filename
VERSION=$(node -p "require('./package.json').version")
npm run build
npx vsce publish -p ${{ secrets.VSCE_PAT }}
run: npx vsce publish -p ${{ secrets.VSCE_PAT }}

publish-open-vsx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20.16.0"

- name: Install dependencies
run: npm ci

- name: Build extension
run: npm run build

- name: Publish to Open VSX Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: npx ovsx publish -p ${{ secrets.OVSX_PAT }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
"pretest": "npm run compile-tests",
"posttest": "npm run lint",
"build": "npx vsce package",
"publish": "npx vsce publish"
"publish": "npx vsce publish",
"publish:ovsx": "npx ovsx publish",
"publish:all": "npm run publish && npm run publish:ovsx"
},
"devDependencies": {
"@types/chai": "^5.0.0",
Expand Down
Loading