diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1fa9dfe..93e25bf 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,8 +10,8 @@ permissions: push: branches: - main - tags-ignore: - - "**" + tags: + - "[0-9]+.[0-9]+.[0-9]$" paths-ignore: - "**/*.md" - LICENSE @@ -272,18 +272,10 @@ jobs: run: ls -R ./npm shell: bash - name: Publish + if: ${{ startsWith(github.ref, 'refs/tags/') }} run: | - if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$"; - then - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - npm publish --access public - elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+"; - then - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - npm publish --tag next --access public - else - echo "Not a release, skipping publish" - fi + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + npm publish --access public env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}