-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (74 loc) · 2.15 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:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["18", "latest"]
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Install xvfb for headless browser testing
run: sudo apt-get install -y xvfb
- name: Setup Node.js (${{ matrix.node-version }})
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: xvfb-run npm run test
package:
runs-on: ubuntu-latest
needs: test
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
- run: npm install --global vsce
- run: vsce package -o ./dist
- uses: actions/upload-artifact@v4
with:
name: vsix-file
path: |
./dist/vscode-stable-sort-*.vsix
release:
if: "startsWith(github.ref, 'refs/tags/')"
needs: package
runs-on: ubuntu-latest
env:
VSCE_PAT: ${{ secrets.VSMARKETPLACE_TOKEN }}
OVSX_PAT: ${{ secrets.OPENVSX_TOKEN }}
steps:
- name: Make sure PATs are accessible.
run: echo $VSCE_PAT | wc -c; echo $OVSX_PAT | wc -c
- name: Check out the repository
uses: actions/checkout@v4
- name: Download already built package files
uses: actions/download-artifact@v4
with:
name: vsix-file
path: dist
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Install vsce
run: npm install -g @vscode/vsce
- name: Publish to Visual Studio Marketplace
run: vsce publish --packagePath ./dist/vscode-stable-sort-*.vsix
timeout-minutes: 5
- name: Install ovsx
run: npm install -g ovsx
- name: Publish to Open VSX Repository
run: ovsx publish --packagePath ./dist/vscode-stable-sort-*.vsix
timeout-minutes: 5