-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (80 loc) · 2.07 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
name: CI
on:
push:
branches:
- master
- validate/*
tags:
- v*
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-18.04
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v1
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- uses: aarnott/nbgv@v0.3
id: nbgv
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
registry-url: https://npm.pkg.github.com
- run: yarn
- name: Build
run: ./build_all.ps1
shell: pwsh
- name: Test
run: yarn test
- name: Stamping NPM versions
run: .github/workflows/set_version.ps1 -Version ${{ steps.nbgv.outputs.NpmPackageVersion }}
shell: pwsh
if: runner.os == 'Linux'
- name: Pack
run: ./pack_all.ps1
shell: pwsh
if: runner.os == 'Linux'
- name: Collect NPM package artifacts
uses: actions/upload-artifact@v1
with:
name: NPM packages
path: out
if: runner.os == 'Linux'
publish:
needs: build
runs-on: ubuntu-18.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # Ideally conditioned on: github.ref == format('refs/tags/v{0}', steps.nbgv.outputs.SemVer2)
steps:
- name: Download NPM package tgz files
uses: actions/download-artifact@v1
with:
name: NPM packages
- name: Prepare to publish to npmjs.org
uses: actions/setup-node@v1
with:
node-version: 10.x
registry-url: https://registry.npmjs.org
- name: Publish NPM packages to npmjs.org
run: |
Get-ChildItem *.tgz |% {
npm publish $_
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
}
shell: pwsh
working-directory: NPM packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}