add github actions

This commit is contained in:
Dave Horton
2023-02-12 08:43:32 -05:00
parent 5aef0dc7c8
commit 51bed6b882
3 changed files with 44 additions and 1 deletions

18
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: CI
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- run: npm ci
- run: npm run jslint
- run: npm test

23
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: npm-publish
# run when a tag is pushed or kick off manually
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -4,7 +4,9 @@
"description": "Jambonz Verb Specification Utilities",
"main": "index.js",
"scripts": {
"test": "node test/"
"test": "node test/",
"jslint": "eslint index.js"
},
"repository": {
"type": "git",