Skip to content

Commit 63b514b

Browse files
committed
ci: add workflow for publishing extensions
1 parent 5545f85 commit 63b514b

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/publish.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish Extension
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*" # Trigger on new version tags
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Node.js with pnpm
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20.x
20+
cache: "pnpm"
21+
22+
- name: Install dependencies
23+
run: pnpm install
24+
25+
- name: Lint code
26+
run: pnpm run lint
27+
28+
- name: Check types
29+
run: pnpm run check-types
30+
31+
- name: Build the extension
32+
run: pnpm run build
33+
34+
- name: Publish to Open VSX Registry
35+
uses: HaaLeo/publish-vscode-extension@v1
36+
id: publishToOpenVSX
37+
with:
38+
pat: ${{ secrets.OVSX_PAT }}
39+
40+
- name: Publish to VS Code Marketplace
41+
if: secrets.VSCE_PAT != ''
42+
uses: HaaLeo/publish-vscode-extension@v1
43+
with:
44+
pat: ${{ secrets.VSCE_PAT }}
45+
registryUrl: https://marketplace.visualstudio.com
46+
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}

0 commit comments

Comments
 (0)