-
Notifications
You must be signed in to change notification settings - Fork 14
53 lines (51 loc) · 1.46 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
name: CI
on: [push, pull_request]
jobs:
check:
name: Check
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
action: [build, lint, test]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 11.x
- run: npm install
- run: npm run ${{ matrix.action }}
release:
name: Release
needs: check
if: github.event_name == 'push'
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 11.x
registry-url: https://registry.npmjs.org
- name: Determine Release Information
id: release-info
uses: ./.github/actions/release-info
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Set Version
run: npm version ${{ steps.release-info.outputs.version }} --git-tag-version=false
- name: Publish
run: |
args=( --tag="${{ steps.release-info.outputs.distTag }}" )
if [ -z "${NODE_AUTH_TOKEN}" ]; then
echo "Auth token not found. Executing dry run publish."
args+=( --dry-run )
fi;
mv dist/core core;
npm publish "${args[@]}"
if [ -z "${NODE_AUTH_TOKEN}" ]; then
echo "Dry run publish complete."
fi;
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}