Skip to content

Commit

Permalink
chore(CI): use new release workflow (#1686)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Dec 22, 2024
1 parent ba9282b commit 239813d
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 341 deletions.
87 changes: 0 additions & 87 deletions .github/workflows/bench-pr.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/issue-label.yml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/release-nightly.yml

This file was deleted.

64 changes: 0 additions & 64 deletions .github/workflows/release-pull-request-with-modernjs.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/release-pull-request-without-modernjs.yml

This file was deleted.

42 changes: 14 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ 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: 'alpha'
options:
- next
- beta
- alpha
- beta
- rc
- canary
- latest
branch:
description: 'Release Branch(confirm release branch)'
description: 'Branch to release'
required: true
default: 'main'

Expand All @@ -26,11 +27,12 @@ jobs:
name: Release
if: github.repository == 'web-infra-dev/rspress' && github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 5
fetch-depth: 1

- name: Install Pnpm
run: corepack enable
Expand All @@ -44,28 +46,12 @@ jobs:
- name: Install npm v9
run: npm install -g npm@9

- name: Nx Cache
id: nx-cache
uses: actions/cache@v4
with:
path: .nx-cache
key: nx-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
nx-${{ github.ref_name }}-
nx-
- name: Install Dependencies && Build
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
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
REPOSITORY: ${{ github.repository }}
REF: ${{ github.ref }}
NPM_TOKEN: ${{ secrets.RSPRESS_NPM_TOKEN }}
run: |
npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
pnpm -r publish --tag ${{ github.event.inputs.npm_tag }} --publish-branch ${{ github.event.inputs.branch }}
Loading

0 comments on commit 239813d

Please sign in to comment.