Skip to content

Commit 3600d6b

Browse files
committed
add ci
1 parent d8c4a9f commit 3600d6b

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Node.js CI
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
if: contains(github.ref, 'refs/tags/') == false
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node-version: [14.x, 16.x]
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Use Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v2
17+
with:
18+
cache: yarn
19+
node-version: ${{ matrix.node-version }}
20+
registry-url: https://registry.npmjs.org
21+
- name: Install packages
22+
run: yarn install --frozen-lockfile
23+
- name: Test
24+
run: yarn run test

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Node.js Publish
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
node-version: [16.x]
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v2
18+
with:
19+
cache: yarn
20+
node-version: ${{ matrix.node-version }}
21+
registry-url: https://registry.npmjs.org
22+
- name: Install packages
23+
run: yarn install --frozen-lockfile
24+
- name: Version
25+
run: yarn version --new-version "${GITHUB_REF:11}" --no-git-tag-version
26+
- name: Publish to NPM
27+
run: yarn publish --access public
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)