From de96cbe3782db1642c6d6602405422aedaef55ca Mon Sep 17 00:00:00 2001 From: msclock Date: Thu, 21 Mar 2024 10:24:57 +0800 Subject: [PATCH] perf(release): use cli instead Signed-off-by: msclock --- .github/workflows/ci.yml | 42 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f4d289..288b51a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,7 +111,10 @@ jobs: name: release runs-on: ubuntu-latest permissions: - contents: write + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + id-token: write # to enable use of OIDC for npm provenance needs: [pass] steps: @@ -119,36 +122,17 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - token: ${{ secrets.GITHUB_TOKEN }} + persist-credentials: false - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: lts/* - - name: Semantic Release - uses: cycjimmy/semantic-release-action@v4 - id: semantic - with: - semantic_version: 22.0.5 - branches: | - [ - '+([0-9])?(.{+([0-9]),x}).x', - 'master', - 'main', - 'next', - 'next-major', - { - name: 'beta', - prerelease: true - }, - { - name: 'alpha', - prerelease: true - } - ] - extra_plugins: | - @semantic-release/exec - @semantic-release/github - conventional-changelog-conventionalcommits + - name: Install dependencies + run: | + npm -i semantic-release@^22.0.5 @semantic-release/exec @semantic-release/github conventional-changelog-conventionalcommits + + - name: Release + run: npx semantic-release env: - GITHUB_TOKEN: ${{ secrets.GH_PAT }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}