-
Notifications
You must be signed in to change notification settings - Fork 255
Expand file tree
/
Copy pathtest-publish.yml
More file actions
51 lines (49 loc) · 1.33 KB
/
test-publish.yml
File metadata and controls
51 lines (49 loc) · 1.33 KB
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
name: Test & Publish
on:
push:
release:
types: [published]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [12.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Start Xvfb
run: |
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
if: matrix.os == 'ubuntu-latest'
- name: Test extension on ${{ matrix.os }}
run: |
npm ci
npm test
env:
DISPLAY: ':99.0'
CI: 'true'
publish:
needs: [test]
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Package extension
run: |
tag=${GITHUB_REF#refs/tags/}
echo "Setting package version $tag"
npm --no-git-tag-version version "$tag"
npx vsce package
- name: Publish extension to marketplace
env:
AZURE_TOKEN: ${{ secrets.AZURE_TOKEN }}
run: |
npx vsce publish -p "$AZURE_TOKEN"