Skip to content

Commit

Permalink
(ci) add node ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSettler committed Jul 29, 2022
1 parent abdcaab commit 8648b4c
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: NPM

on:
push:
branches:
- 'master'
release:
types:
- published

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16.x ]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --freeze-lockfile
- name: Lint
run: yarn lint

test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16.x ]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --freeze-lockfile
- name: Test
run: yarn test

publish:
name: Build and Publish to NPM
runs-on: ubuntu-latest
needs:
- lint
- test
if: github.event_name == 'release'
strategy:
matrix:
node-version: [ 16.x ]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --freeze-lockfile
- name: Build and publish
run: yarn build & npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 8648b4c

Please sign in to comment.