From 91d1750cdf75d4ea5578a9e03583374c1cfa446d Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 21 Dec 2024 20:39:45 +0800 Subject: [PATCH] chore(CI): update release workflow (#4233) --- .github/workflows/release.yml | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f147427637..ad776f0f96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,16 +3,17 @@ name: Release on: workflow_dispatch: inputs: - version: + npm_tag: type: choice - description: 'Release Version (next, beta, alpha, latest)' + description: 'Specify npm tag' required: true - default: 'next' + default: 'latest' options: - - next - - beta - - alpha - latest + - alpha + - beta + - rc + - canary branch: description: 'Release Branch (confirm release branch)' required: true @@ -31,6 +32,7 @@ jobs: name: Release if: github.repository == 'web-infra-dev/rsbuild' && github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest + environment: production steps: - name: Run Ecosystem CI if: inputs.run_eco_ci == true @@ -39,14 +41,14 @@ jobs: owner: "rspack-contrib" repo: "rsbuild-ecosystem-ci" workflow_file_name: "ecosystem-ci-selected.yml" - github_token: ${{ secrets.REPO_SCOPED_TOKEN }} + github_token: ${{ secrets.REPO_RSBUILD_ECO_CI_GITHUB_TOKEN }} ref: "main" client_payload: '{"ref":"${{ github.event.inputs.branch }}","repo":"web-infra-dev/rsbuild","suite":"-","suiteRefType":"precoded","suiteRef":"precoded"}' - name: Checkout uses: actions/checkout@v4 with: - fetch-depth: 25 + fetch-depth: 1 ref: ${{ github.event.inputs.branch }} - name: Install Pnpm @@ -61,15 +63,7 @@ jobs: - name: Install Dependencies run: pnpm install - - name: Release - uses: web-infra-dev/actions@v2 - with: - version: ${{ github.event.inputs.version }} - branch: ${{ github.event.inputs.branch }} - type: 'release' - tools: 'changeset' + - name: Publish to npm + run: pnpm -r publish --tag ${{ github.event.inputs.npm_tag }} env: - GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - REPOSITORY: ${{ github.repository }} - REF: ${{ github.ref }} + NODE_AUTH_TOKEN: ${{ secrets.RSBUILD_NPM_TOKEN }}