From ba1372d306f53582e8b9516a7024d9bc38361de4 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Tue, 20 Jul 2021 15:20:22 +0500 Subject: [PATCH] Create npm-publish.yml --- .github/workflows/npm-publish.yml | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 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 00000000..ba86fda8 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,39 @@ +name: Publish NPM package + +on: + release: + types: [created] + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14 + registry-url: https://registry.npmjs.org/ + + - name: Install dependencies + run: | + yarn install + npm i -g npm@7 --registry=https://registry.npmjs.org + + - name: Lint + run: | + yarn lint + yarn type-check + + - name: Test + run: yarn test:ci + + - name: Build package + run: | + npm --no-git-tag-version version ${GITHUB_REF#refs/*/} + npm set-script prepare "" + yarn build + + - name: Publish build + run: npm publish ./build --access public + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}}