-
-
Notifications
You must be signed in to change notification settings - Fork 32
90 lines (74 loc) · 2.08 KB
/
ci.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: CI
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
name: Node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v1
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Test (Linux)
run: xvfb-run -a npm test
if: runner.os == 'Linux'
- name: Test (non-Linux)
run: npm test
if: runner.os != 'Linux'
- name: Vscode package plugin
uses: JCofman/vscodeaction@master
with:
args: package -o package.vsix
- uses: actions/upload-artifact@v2
with:
name: package
path: package.vsix
release:
if: startsWith(github.ref, 'refs/tags/v') && !endsWith(github.ref, '-pre')
needs: build
runs-on: ubuntu-latest
name: Release
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v2
with:
name: package
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: package.vsix
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.PUBLISHER_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: package.vsix
pre-release:
if: endsWith(github.ref, '-pre')
needs: build
runs-on: ubuntu-latest
name: Pre-release
steps:
- uses: actions/checkout@v1
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 18.x
- run: npm install
- name: Vscode release plugin
uses: JCofman/vscodeaction@master
env:
PUBLISHER_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
with:
args: publish -p $PUBLISHER_TOKEN --pre-release