X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=.github%2Fworkflows%2Fnpmpublish.yml;h=29b40075239ed0a10edb80efd84437cc4e87ea11;hb=24c3fcb499d1594f698611fd10219de01993071e;hp=797287343717a5fd73800a965e9cd30f7595eac8;hpb=515e5da7461f84786a9b6acf859cf65a083e2f4c;p=poolifier.git diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 79728734..29b40075 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -10,16 +10,28 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Setup Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: 12 - - run: npm ci - - run: npm run test - - run: npm run lint - - run: npm run coverage + node-version: 16 + + - 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 @@ -27,18 +39,31 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Setup Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: 12 + node-version: 16 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 Release + if: ${{ contains(steps.package-version.outputs.version, '-') == false }} + run: | + npm login + npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Publish - run: npm publish + - 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 }}