-
-
Notifications
You must be signed in to change notification settings - Fork 106
74 lines (58 loc) · 1.77 KB
/
json-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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: pygls-playground
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: .vscode/extensions/pygls-playground
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: 'npm'
cache-dependency-path: '.vscode/extensions/pygls-playground/package-lock.json'
- name: Install dependencies
run: |
npm ci
npm i vsce
- name: Lint
run: npx eslint src/*.ts
- name: Compile
run: npm run compile
- name: Replace package.json version
run: |
replace_packagejson_version() {
version_line=$(grep -o '"version".*' $1)
version=$(python -m json.tool package.json | awk -F'"' '/version/{print $4}')
build_version=$version+$2
build_version_line=${version_line/$version/$build_version}
sed -i "s|$version_line|$build_version_line|g" $1
cat $1
}
replace_packagejson_version package.json $GITHUB_RUN_ID
- name: Build VSIX
run: npx vsce package
- name: Validate VSIX
run: |
npx vsce ls | grep package.json
npx vsce ls | grep out/extension.js
- name: Upload VSIX
uses: actions/upload-artifact@v4
with:
name: pygls-playground-vsix
# The path must be rooted from the directory GitHub Actions starts
# from, not the working-directory.
path: .vscode/extensions/pygls-playground/*.vsix
if-no-files-found: error