From 4f1e9fb2984a6570b9ba5fc05adb53053a4c2191 Mon Sep 17 00:00:00 2001 From: Patrick Delcroix Date: Sat, 16 Dec 2023 23:04:49 +0100 Subject: [PATCH] Update npmpublish.yml --- .github/workflows/npmpublish.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 61bbd22..48cd4fb 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -5,29 +5,38 @@ name: Node.js Package on: release: - types: [created] + types: [published] jobs: build: runs-on: ubuntu-latest steps: + - uses: olegtarasov/get-tag@v2.1 + id: tagName - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 12 + node-version: 16 + - name: update the version with TAG + run: echo $(jq --arg a "$GIT_TAG_NAME" '.version = ($a)' package.json) > package.json - run: yarn install - - run: yarn build + - run: yarn build + publish-npm: needs: build runs-on: ubuntu-latest steps: + - uses: olegtarasov/get-tag@v2.1 + id: tagName - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 12 + node-version: 16 registry-url: https://registry.npmjs.org/ scope: openimis + - name: update the version with TAG + run: echo $(jq --arg a "$GIT_TAG_NAME" '.version = ($a)' package.json) > package.json - run: yarn install - run: yarn build - run: npm publish --access public @@ -38,14 +47,17 @@ jobs: needs: build runs-on: ubuntu-latest steps: + - uses: olegtarasov/get-tag@v2.1 + id: tagName - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 12 + node-version: 16 registry-url: https://npm.pkg.github.com/ + - name: update the version with TAG + run: echo $(jq --arg a "$GIT_TAG_NAME" '.version = ($a)' package.json) > package.json - run: yarn install - run: yarn build - run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - \ No newline at end of file