From 51bed6b882543f94517f994b15b0a2869680ed15 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Sun, 12 Feb 2023 08:43:32 -0500 Subject: [PATCH] add github actions --- .github/workflows/ci.yml | 18 ++++++++++++++++++ .github/workflows/publish.yml | 23 +++++++++++++++++++++++ package.json | 4 +++- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..947cfca --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..81153cc --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/package.json b/package.json index 2ea2c32..92e759c 100644 --- a/package.json +++ b/package.json @@ -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",