Skip to content

Commit eacde33

Browse files
committed
Add build workflow
This is necessary to pull dependencies during build for different operating systems.
1 parent 86bc350 commit eacde33

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build VSCode Extension (multi-platform)
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
workflow_dispatch: {}
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
node: [20]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies (including dev)
27+
run: npm ci
28+
29+
- name: Compile TypeScript
30+
run: npm run compile
31+
32+
- name: Package VSIX
33+
shell: bash
34+
run: |
35+
if [ "${{ runner.os }}" = "Windows" ]; then
36+
npx @vscode/vsce package --target win32-x64
37+
elif [ "${{ runner.os }}" = "Linux" ]; then
38+
npx @vscode/vsce package --target linux-x64
39+
elif [ "${{ runner.os }}" = "macOS" ]; then
40+
npx @vscode/vsce package --target darwin-arm64
41+
fi
42+
43+
- name: Upload VSIX artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: vscode-extension-${{ runner.os }}
47+
path: '*.vsix'

0 commit comments

Comments
 (0)