X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=.github%2Fworkflows%2Fnpmpublish.yml;h=c62f0b540b0782b9932ac49967a9b645034941d1;hb=4b8093f6b901289287640b2046cf9eb18d54cbc9;hp=d0597e52e56d82e013018d94bb03d6203124c3c6;hpb=ec66e82b95433442e9f2afa53a34a806bd3f330f;p=poolifier.git diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index d0597e52..c62f0b54 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -16,10 +16,22 @@ jobs: 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 + + - 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 @@ -35,10 +47,21 @@ jobs: node-version: 12 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 --production + run: npm ci - - name: Publish + - name: Publish Release + if: ${{ contains(steps.package-version.outputs.version, '-') == false }} run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} + + - name: Publish Beta + if: ${{ contains(steps.package-version.outputs.version, 'beta') }} + run: npm publish --tag beta + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}}