-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (33 loc) · 1.08 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Publish VS Code Extension
on:
create:
tags:
- 'v*' # Trigger on creating version tags (e.g., v1.0.0)
jobs:
publish:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Check out the code
uses: actions/checkout@v3
# Step 2: Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Use Node version compatible with vsce
# Step 3: Install vsce globally
- name: Install vsce
run: npm install -g vsce
# step 3.5: install packages
- name: Install dependencies
run: npm install
# Step 4: Authenticate using your Personal Access Token (PAT)
- name: Authenticate with the Visual Studio Marketplace
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: echo "//vsce.dev/_authToken=$VSCE_PAT" > ~/.npmrc
# Step 5: Run vsce publish to publish the extension
- name: Publish the Extension
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: vsce publish