From ba0bdb7751006cc7b1476cf40d96eaca306dbed9 Mon Sep 17 00:00:00 2001 From: mochatek Date: Sun, 26 May 2024 21:15:22 +0530 Subject: [PATCH] ci: add github actions --- .github/publish-to-npm.yml | 30 ++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/publish-to-npm.yml diff --git a/.github/publish-to-npm.yml b/.github/publish-to-npm.yml new file mode 100644 index 0000000..eb1bc78 --- /dev/null +++ b/.github/publish-to-npm.yml @@ -0,0 +1,30 @@ +# This workflow will build the publish the jsonarrayfs package to NPM when a version-tagged commit is pushed + +name: Publish jsonarrayfs library to NPM + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + +permissions: + contents: read + +jobs: + build-and-publish: + name: Build dist from source and publish the artifacts to NPM + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: "18.x" + registry-url: "https://registry.npmjs.org" + - name: Install dependencies and build + run: npm ci && npm run build + - name: Publish package to NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 73e3262..8e7306f 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "stream", "json array", "chunk", - "batch" + "batch", + "append json" ], "author": "Akash S Panickar", "license": "MIT",