-
Notifications
You must be signed in to change notification settings - Fork 6
60 lines (48 loc) · 1.3 KB
/
node.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
name: Node CI
on:
push:
branches:
- '**'
tags:
- 'v**'
workflow_dispatch:
jobs:
run-yarn-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: yarn install
run: yarn install --check-files --frozen-lockfile
- name: yarn validate:dependencies
run: yarn validate:dependencies
- name: yarn build
run: yarn build
- name: yarn unit test
run: yarn unit
- name: yarn install production
run: yarn install --check-files --frozen-lockfile --production --force
- uses: actions/upload-artifact@main
with:
name: dist artifacts
path: dist
npm-release:
runs-on: ubuntu-latest
needs: [run-yarn-build]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: dist artifacts
path: dist
- name: yarn install
run: yarn install
- uses: JS-DevTools/npm-publish@v1
with:
access: public
token: ${{ secrets.NPM_TOKEN }}