-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (32 loc) · 1.29 KB
/
build.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
42
name: Build and Upload VSCode Extension as Artifact
on:
push:
branches:
- main # Trigger the action when pushing to the main branch (adjust if you use a different branch)
pull_request:
branches:
- main # Trigger the action when a PR is opened to the main branch
jobs:
build:
runs-on: ubuntu-latest # You can change this to 'windows-latest' or 'macos-latest' if needed
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js 20
uses: actions/setup-node@v3
with:
node-version: '20' # Change Node.js version to 20
- name: Install dependencies
run: npm install
- name: Install VSCE
run: npm install -g @vscode/vsce
- name: Build VSCode Extension
run: vsce package # This will generate the .vsix package of your extension
- name: Get package version
id: get_version
run: echo "PACKAGE_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
- name: Upload VSCode Extension as Artifact
uses: actions/upload-artifact@v3
with:
name: vscode-extension # Name of the artifact (you can change this)
path: '*.vsix' # Path to the .vsix file (adjust this if your file is in a subdirectory)