diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index c68dc7d..953d8ea 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -1,7 +1,7 @@ name: Preview docs on: pull_request: - branches: production + branches: 'main' paths: - docs/** - '*rc' @@ -10,7 +10,7 @@ on: - '*.lock' - .github/workflows/preview-docs.yml concurrency: - group: ${{ github.workflow }} + group: ${{ github.workflow }}-${{ github.ref_name }} cancel-in-progress: true jobs: preview-docs: diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 270cb83..1838e70 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,11 +1,9 @@ name: Publish npm on: release: - types: [published, prereleased] + types: published workflow_dispatch: -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: true +concurrency: ${{ github.workflow }} jobs: publish-npm: runs-on: ubuntu-latest @@ -17,12 +15,10 @@ jobs: registry-url: https://registry.npmjs.org/ - run: npm ci - run: npm test - - name: Publish to npm - run: | - if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then - npm publish --tag next --access public - else - npm publish --access public - fi + - run: npm publish --tag next + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + - if: '!github.event.release.prerelease' + run: npm dist-tag add "$(npm view . name)@$(npm view . version)" latest env: NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 22a899b..dbd452a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ name: Test on: push: - branches: 'production' + branches: 'main' paths: - src/** - test/** @@ -10,7 +10,7 @@ on: - '*.json' - .github/workflows/test.yml pull_request: - branches: 'production' + branches: 'main' paths: - src/** - test/** @@ -19,7 +19,7 @@ on: - '*.json' - .github/workflows/test.yml concurrency: - group: test-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref_name }} cancel-in-progress: true jobs: test: