Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(CI): update release workflow #4233

Merged
merged 2 commits into from
Dec 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Loading