Skip to content

Commit 14edcbd

Browse files
committed
ci: add VSCode Marketplace publish
1 parent 9b750ed commit 14edcbd

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

.github/workflows/extension-build.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: extension
1+
name: extension-build
22

33
on:
44
push:
@@ -23,9 +23,3 @@ jobs:
2323

2424
- name: Build
2525
run: pnpm run build && pnpm --filter volar run pack
26-
27-
- name: Upload Artifact
28-
uses: actions/upload-artifact@v4
29-
with:
30-
name: extensions
31-
path: ./extensions/vscode/volar-*.vsix

.github/workflows/extension-release.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: extension
1+
name: extension-release
22

33
on:
44
workflow_dispatch:
@@ -16,15 +16,20 @@ jobs:
1616
node-version: 20
1717
cache: pnpm
1818

19+
- name: Install global tools
20+
run: pnpm install -g @vscode/vsce ovsx
21+
1922
- name: Install dependencies
20-
run: pnpm install -g ovsx && pnpm install --frozen-lockfile
23+
run: pnpm install --frozen-lockfile
2124

2225
- name: Build
2326
run: pnpm run build && pnpm --filter volar run build:prod
2427

25-
- name: Publish
28+
- name: Publish to Open VSX
29+
id: publish_ovsx
2630
run: |
2731
VERSION=$(jq -r .version package.json)
32+
echo "version=$VERSION" >> $GITHUB_OUTPUT
2833
if [[ "$VERSION" == *-* ]]; then
2934
echo "Detected prerelease version: $VERSION"
3035
pnpm ovsx publish --pre-release
@@ -35,3 +40,10 @@ jobs:
3540
working-directory: extensions/vscode
3641
env:
3742
OVSX_PAT: ${{ secrets.OVSX_PAT }}
43+
44+
- name: Publish to VSCode Marketplace
45+
if: ${{ !contains(steps.publish_ovsx.outputs.version, '-') }}
46+
working-directory: extensions/vscode
47+
env:
48+
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
49+
run: vsce publish

0 commit comments

Comments
 (0)