Skip to content

Commit 2589280

Browse files
author
Dante
committed
feat: add CI and publish workflows for automated testing and deployment
1 parent 3e0611b commit 2589280

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run tests
27+
run: npm test
28+
29+
- name: Compile extension
30+
run: npm run compile

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Extension
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Run tests
26+
run: npm test
27+
28+
- name: Compile extension
29+
run: npm run compile
30+
31+
- name: Package extension
32+
run: npx @vscode/vsce package
33+
34+
- name: Publish to VS Code Marketplace
35+
run: npx @vscode/vsce publish -p ${{ secrets.VSCE_TOKEN }}
36+
env:
37+
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
38+
39+
- name: Upload VSIX as artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: vsix-package
43+
path: '*.vsix'

0 commit comments

Comments
 (0)