diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 886c728..e5e02d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: - run: npm test - run: npm run build --if-present - name: Save build - if: matrix.node-version == '14.x' + if: matrix.node-version == '16.x' uses: actions/upload-artifact@v2 with: name: build @@ -52,7 +52,7 @@ jobs: name: build - uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 16.x - uses: rlespinasse/github-slug-action@v3.x - name: Append commit hash to package version run: 'sed -i -E "s/(\"version\": *\"[^\"]+)/\1-${GITHUB_SHA_SHORT}/" package.json' @@ -62,3 +62,21 @@ jobs: with: token: ${{ secrets.NPM_TOKEN }} tag: ${{ env.GITHUB_REF_SLUG }} + + npm-publish-latest: + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - uses: actions/download-artifact@v2 + with: + name: build + - uses: actions/setup-node@v1 + with: + node-version: 16.x + - name: Disable pre- and post-publish actions + run: 'sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json' + - uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} + tag: latest