forked from denoland/vscode_deno
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (72 loc) · 2.12 KB
/
build.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
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
if: |
github.event_name == 'push' ||
!startsWith(github.event.pull_request.head.label, 'denoland:')
strategy:
matrix:
node: ["12.16.1"]
deno: ["1.4.0"]
os: [ubuntu-latest, macOS-latest, windows-latest]
name: test in ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Deno
uses: denolib/setup-deno@master
with:
deno-version: ${{ matrix.deno }}
- name: Environment
run: |
node -v
npm -v
deno --version
- name: Install
run: npm i
- name: Check code format
run: npm run check
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Compile
run: npm run compile
- name: Package
run: npm run build
- name: Release
if: |
startsWith(matrix.os, 'ubuntu') &&
github.repository == 'denoland/vscode_deno' &&
startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
vscode-deno.vsix
- name: Publish
if: |
startsWith(matrix.os, 'ubuntu') &&
github.repository == 'denoland/vscode_deno' &&
startsWith(github.ref, 'refs/tags/')
env:
# https://dev.azure.com/propelml/_usersSettings/tokens
AZURE_PAT: ${{ secrets.AZURE_PAT }}
run: npx vsce publish --pat $AZURE_PAT