-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (45 loc) · 1.13 KB
/
publish.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
# workflow to publish on npm
name: publish
on:
# trigger on main branch
push:
branches: [main]
# allow manual dispatch
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
# checkout repo
- name: Git checkout
uses: actions/checkout@v2
# setup Node.js
- name: Set Node.js - v${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
# install dependencies
- name: Install dependencies
run: yarn
# run tests
- name: Run tests
run: yarn test
# coverage
- name: Publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: yarn coverage
debug: true
# build dist
- name: Build package
run: yarn build
# publish on npm
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: "public"