From 762ddce8f81598b915646df5f068300aa7140c4f Mon Sep 17 00:00:00 2001 From: Allan Oliveira Miraballes <41436010+AllanOliveiraM@users.noreply.github.com> Date: Thu, 8 Sep 2022 10:33:17 -0300 Subject: [PATCH] Create npm-publish.yml --- .github/workflows/npm-publish.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..71db8d1 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,33 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: node:17 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 17 + - run: yarn + - run: yarn type:check + - run: NODE_ENV='production' yarn build:dist + + publish-npm: + needs: build + runs-on: node:17 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 17 + registry-url: https://registry.npmjs.org/ + - run: yarn publish --no-git-tag-version + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}}