X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=.github%2Fworkflows%2Fnpmpublish.yml;h=d6bbad9d78b5b79e3a374786b25d9ffe0f7e0577;hb=4f4ae1cb3c33228a023ea599c2648268d15e6c0f;hp=5882753099ee54a64a402ebf4a62a8989117a02e;hpb=90bd5e4759bd31cc25b6f42e88d07ed05b969cec;p=poolifier.git diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 58827530..d6bbad9d 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -15,11 +15,23 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: 12 - - run: npm ci - - run: npm run test:prod - - run: npm run lint - - run: npm run coverage + node-version: '16.x' + + - name: Install + run: npm ci + + - name: Production Build + run: npm run build:prod + + - name: Lint + run: npm run lint + + - name: Production Tests & Coverage + run: | + npm run test:prod + npm run coverage + env: + CI: true publish-npm: needs: build @@ -32,19 +44,24 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: 12 + node-version: '16.x' registry-url: https://registry.npmjs.org/ + - name: Read package.json version + uses: tyankatsu0105/read-package-version-actions@v1 + id: package-version + - name: Install run: npm ci - - name: Build - run: npm run build:prod - - - name: Install Production - run: npm ci --production + - name: Publish Release + if: ${{ contains(steps.package-version.outputs.version, '-') == false }} + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Publish - run: npm publish --prepublishOnly + - name: Publish Beta + if: ${{ contains(steps.package-version.outputs.version, 'beta') }} + run: npm publish --tag beta env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}