Skip to content

Commit

Permalink
Create ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
catdad authored Nov 12, 2023
1 parent dc0d09e commit 9ba3566
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
pull_request:
branches: [ master ]

env:
FORCE_COLOR: 1

jobs:
test:
runs-on: ubuntu-latest
name: test with node ${{ matrix.node-version }}
strategy:
matrix:
node-version: [12, 14, 16, 18, 20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- name: Inspect tarball
run: npm pack --dry-run

publish:
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm publish --loglevel verbose
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit 9ba3566

Please sign in to comment.