-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (49 loc) · 1.51 KB
/
ci.yaml
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
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
cache: npm
- run: npm ci
- run: npm run compile
- run: npm run lint
# NOTE
# official reference
# https://code.visualstudio.com/api/working-with-extensions/continuous-integration#automated-publishing
#
# You'll see `Failed to connect to the bus` many time.
# https://github.com/microsoft/vscode-test/issues/127
- run: xvfb-run -a npm test
# upload package for debug
- run: npx vsce package
- uses: actions/upload-artifact@v4
with:
name: bq-extension-vscode.vsix
path: ./bq-extension-vscode-*.vsix
deploy:
runs-on: ubuntu-latest
needs: test
if: ${{ github.ref_type == 'tag' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
cache: npm
- uses: kitta65/tag-version-match@main
with:
file: ./package.json
query: .version
pattern: '^([0-9]+\.[0-9]+\.[0-9]+)$'
- uses: actions/download-artifact@v4
with:
name: bq-extension-vscode.vsix
- run: npx @vscode/vsce publish --packagePath ./bq-extension-vscode-*.vsix
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}