-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (60 loc) · 1.51 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
# Adapted from https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions
name: Tests and publishing
on:
push:
branches:
- main
pull_request:
release:
types:
- created
jobs:
tests:
name: Tests ${{ matrix.os }} - Node ${{ matrix.node }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node:
- 18.x
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Compile
run: npm install && npm run compile
- name: Run tests on Linux with xvfb-run
run: xvfb-run -a npm test
if: runner.os == 'Linux'
- name: Run tests on Windows or macOS
run: npm test
if: runner.os != 'Linux'
publishRelease:
name: Publish Release
needs: [tests]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create package
run: |
npm install
npm run compile
npm run package
- name: Publish Release to VS Code Marketplace
if: "!github.event.release.prerelease"
run: npm run publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Upload package to release
uses: softprops/action-gh-release@v2
with:
files: '*.vsix'