diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..862e522 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,23 @@ +name: Publish to NPM + +on: + release: + types: [published] + +jobs: + build: + name: "Build and Deploy" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm install + - run: npm run linter + - run: npm run test + - run: npm run build + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index af4745e..2594834 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,13 @@ "analysis", "device" ], + "engines": { + "node": ">=16.0.0", + "npm": ">=6.0.0" + }, "scripts": { "start": "node -r @swc-node/register ./src/index.ts", - "build": "rm -rf ./out; tsc --build", + "build": "rm -rf ./build; tsc --build", "linter": "eslint .", "test": "jest" },