From 1c97b0439d3abef56f472de2cac9b2ae1c92f282 Mon Sep 17 00:00:00 2001 From: Tao Jianhang <1516544795@qq.com> Date: Mon, 16 Oct 2023 13:43:41 +0800 Subject: [PATCH] =?UTF-8?q?ci(yml):=20=E8=87=AA=E5=8A=A8release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-merge.yml | 30 ------------------------- .github/workflows/npm-publish.yaml | 2 +- .github/workflows/release.yml | 35 ++++++++++++++++++++++++------ 3 files changed, 29 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/auto-merge.yml diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml deleted file mode 100644 index 1254b8e..0000000 --- a/.github/workflows/auto-merge.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Automerge - -on: - pull_request: - types: - - labeled - - unlabeled - - synchronize - - opened - - edited - - ready_for_review - - reopened - - unlocked - pull_request_review: - types: - - submitted - status: {} - -jobs: - # 合并发布版本的 pr 到 master - auto-merge: - runs-on: ubuntu-latest - steps: - - name: Automerge - uses: 'pascalgn/automerge-action@v0.15.6' - env: - GITHUB_TOKEN: '${{ secrets.RELEASE_TOKEN }}' - MERGE_LABELS: '' - MERGE_FILTER_AUTHOR: 'aliothor' - diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml index e9ca653..fbd0d55 100644 --- a/.github/workflows/npm-publish.yaml +++ b/.github/workflows/npm-publish.yaml @@ -1,4 +1,4 @@ -name: Publish Package to npmjs +name: Publish Package To Npm permissions: contents: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 828c2fa..fdc635f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,18 +1,39 @@ +name: release-please + on: push: branches: - - master - -name: Release + - main jobs: release-please: runs-on: ubuntu-latest steps: - - uses: GoogleCloudPlatform/release-please-action@v3 + - uses: google-github-actions/release-please-action@v3 id: release with: - token: ${{ secrets.RELEASE_TOKEN }} release-type: node - package-name: standard-version - changelog-types: '[{"type": "types", "section":"Types", "hidden": false},{"type": "revert", "section":"Reverts", "hidden": false},{"type": "feat", "section": "Features", "hidden": false},{"type": "fix", "section": "Bug Fixes", "hidden": false},{"type": "improvement", "section": "Feature Improvements", "hidden": false},{"type": "docs", "section":"Docs", "hidden": false},{"type": "style", "section":"Styling", "hidden": false},{"type": "refactor", "section":"Code Refactoring", "hidden": false},{"type": "perf", "section":"Performance Improvements", "hidden": false},{"type": "test", "section":"Tests", "hidden": false},{"type": "build", "section":"Build System", "hidden": false},{"type": "ci", "section":"CI", "hidden":false}]' + package-name: release-please-action + # Checkout + - uses: actions/checkout@v3 + if: ${{ steps.release.outputs.release_created }} + # Setup node + - uses: actions/setup-node@v3 + with: + node-version: 20 + registry-url: 'https://registry.npmjs.org' + if: ${{ steps.release.outputs.release_created }} + # Setup pnpm + - uses: pnpm/action-setup@v2 + if: ${{ steps.release.outputs.release_created }} + # Install dependencies + - run: pnpm install + if: ${{ steps.release.outputs.release_created }} + # Build output + - run: pnpm build + if: ${{ steps.release.outputs.release_created }} + # Publish to npm + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + if: ${{ steps.release.outputs.release_created }} \ No newline at end of file