Skip to content

Commit f4c12d0

Browse files
authored
Merge pull request #43 from jokroese/open-vsx
ci: add GitHub workflow for extension publishing
2 parents ffe708b + 04f30c3 commit f4c12d0

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-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 }}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "vscode-shadcn-svelte",
33
"version": "0.1.14",
4+
"license": "MIT",
45
"displayName": "shadcn/svelte",
56
"description": "Integrate components and snippets from Shadcn/Svelte directly into your IDE ✨.",
67
"publisher": "Selemondev",
@@ -139,6 +140,7 @@
139140
"build": "pnpm run lint && node esbuild.js --production",
140141
"dev": "pnpm build -- --watch",
141142
"deploy:extension": "vsce publish --no-dependencies",
143+
"deploy:openvsx": "ovsx publish -p $OVSX_PAT",
142144
"lint": "eslint src --ext ts"
143145
},
144146
"devDependencies": {

0 commit comments

Comments
 (0)