Skip to content

Commit

Permalink
chore(CI): update release workflow (#4233)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Dec 21, 2024
1 parent d670368 commit 91d1750
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }}

0 comments on commit 91d1750

Please sign in to comment.