Skip to content

Commit 37d7cc9

Browse files
authored
build: add publish extension workflow
1 parent d05a53d commit 37d7cc9

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
on:
2+
push:
3+
tags:
4+
- "*"
5+
6+
name: Deploy and Release Extension
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
18+
- run: npm ci
19+
20+
- name: Package Extension
21+
run: npx vsce package
22+
23+
- name: Get tag name
24+
id: get_tag
25+
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
26+
27+
- name: Upload .vsix to GitHub Release
28+
uses: softprops/action-gh-release@v2
29+
with:
30+
files: "*.vsix"
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Publish to Visual Studio Marketplace
35+
uses: HaaLeo/publish-vscode-extension@v2
36+
with:
37+
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
38+
registryUrl: https://marketplace.visualstudio.com

0 commit comments

Comments
 (0)