-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.43 KB
/
build-extension.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
43
44
45
46
47
48
49
50
51
52
name: Build and Publish Extension
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
build:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: astral-sh/setup-uv@v3
- name: Update Version Numbers
if: startsWith(github.ref, 'refs/tags/')
run: |
VERSION=$(echo ${{ github.ref }} | sed 's/refs\/tags\/v//')
if ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid version format: $VERSION. Expected format: X.Y.Z"
exit 1
fi
for file in client/package.json client/package-lock.json server/server.py; do
sed -i "s/0\.0\.0+dynamic-from-tags/$VERSION/" "$file"
done
- name: Install Dependencies
run: cd client && npm ci
- name: Compile and Create VSIX
run: |
cd client
npm install
npm install -g vsce
npm run compile
npm run webpack
npm run vscepack
- name: Upload VSIX as Artifact
uses: actions/upload-artifact@v4
with:
name: extension-package
path: client/*.vsix
- name: Publish to VS Code Marketplace
if: startsWith(github.ref, 'refs/tags/')
run: |
cd client
vsce publish -p ${{ secrets.VSCODE_MARKETPLACE_PRIVATE_ACCESS_TOKEN }}