Skip to content

Commit 67e1879

Browse files
committed
Add Github Actions build & publish workflow
1 parent 839096e commit 67e1879

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Ubuntu CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
name: Build & Test
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [12.x]
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- run: yarn install --frozen-lockfile
23+
- run: yarn build
24+
- run: yarn test
25+
- name: Archive production artifacts
26+
uses: actions/upload-artifact@v1
27+
with:
28+
name: build
29+
path: lib

.github/workflows/publish.yml

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

0 commit comments

Comments
 (0)