From e105bf3d04ae9d16b8acb250b447985eb60d70a0 Mon Sep 17 00:00:00 2001 From: onlyhom Date: Fri, 26 Aug 2022 15:30:04 +0800 Subject: [PATCH] ci(workflow): auto publish to npm when release pr is merged --- .github/workflows/build-release.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index f6fe53f..b124c5e 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -39,11 +39,8 @@ jobs: committer_email: github-actions[bot]@users.noreply.github.com push: true - release-and-publish: - runs-on: ubuntu-latest - needs: [build] - steps: - uses: google-github-actions/release-please-action@v3 + id: release with: release-type: node token: ${{ secrets.GH_TOKEN }} @@ -55,7 +52,7 @@ jobs: { "type": "perf", "section": "Performance", "hidden": false }, { "type": "refactor", "section": "Refactor", "hidden": false }, { "type": "docs", "section": "Documentation","hidden": false }, - { "type": "ci", "section": "CI/CD", "hidden": false }, + { "type": "ci", "section": "CI/CD", "hidden": true }, { "type": "revert", "section": "Reverts", "hidden": true }, { "type": "test", "section": "Tests", "hidden": true }, { "type": "build", "section": "Build", "hidden": true }, @@ -67,3 +64,4 @@ jobs: uses: JS-DevTools/npm-publish@v1 with: token: ${{ secrets.NPM_TOKEN }} + if: ${{ steps.release.outputs.release_created }}