Skip to content

chore(CI): use new release workflow #592

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

Merged
merged 6 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
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
87 changes: 0 additions & 87 deletions .github/workflows/bench-pr.yml

This file was deleted.

10 changes: 1 addition & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
name: Lint

# Controls when the action will run.
on:
# Triggers the workflow on pull request events but only for the main branch
pull_request:
branches: [main]

push:
branches: [main]

merge_group:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
lint:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -30,7 +22,7 @@ jobs:
- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/release-pull-request.yml

This file was deleted.

34 changes: 15 additions & 19 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,17 +27,18 @@ jobs:
name: Release
if: github.repository == 'web-infra-dev/rslib' && github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 25
fetch-depth: 1
ref: ${{ github.event.inputs.branch }}

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
Expand All @@ -45,15 +47,9 @@ 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
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
REPOSITORY: ${{ github.repository }}
REF: ${{ github.ref }}
NPM_TOKEN: ${{ secrets.RSLIB_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 }}
12 changes: 1 addition & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
name: Test

# Controls when the action will run.
on:
# Triggers the workflow on pull request events but only for the main branch
pull_request:
branches: [main]

push:
branches: [main]

merge_group:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# ======== calculate changes ========
changes:
Expand All @@ -25,7 +19,6 @@ jobs:
matrix:
node-version: [18]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -35,7 +28,7 @@ jobs:
- name: Install Pnpm
run: corepack enable

- uses: dorny/paths-filter@v3
- uses: dorny/paths-filter@v3.0.2
id: changes
with:
predicate-quantifier: 'every'
Expand All @@ -59,7 +52,6 @@ jobs:
- node-version: 18
os: windows-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -100,7 +92,6 @@ jobs:
- node-version: 18
os: windows-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Git config
if: ${{ matrix.os == 'windows-latest' }}
Expand Down Expand Up @@ -141,7 +132,6 @@ jobs:
matrix:
node-version: [20]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
21 changes: 6 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,12 @@ pnpm run lint

For VS Code users, you can install the [Biome VS Code extension](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) to see lints while typing.

# Versioning

We use [changesets](https://github.com/changesets/changesets) to manage version. Currently, all rslib packages will use a fixed unified version.

The release notes are automatically generated by [GitHub releases](https://github.com/web-infra-dev/rslib/releases).

## Releasing

Repository maintainers can publish a new version of all packages to npm.

Here are the steps to publish (we generally use CI for releases and avoid publishing npm packages locally):

<!-- 1. [Create release pull request](https://github.com/web-infra-dev/rslib/actions/workflows/release-pull-request.yml). -->
Repository maintainers can publish a new version of changed packages to npm.

1. Run `pnpm generate-release-pr` to create a release pull request.
2. [Run the release action on release branch](https://github.com/web-infra-dev/rslib/actions/workflows/release.yml).
3. Merge the release pull request.
4. [Create Git tag on main branch and generate the release notes](https://github.com/web-infra-dev/rslib/releases).
1. Run `pnpm generate-release-pr` to generate a release branch.
2. Create a pull request, the title should be `release: v1.2.0`.
3. Run the [release action](https://github.com/web-infra-dev/rsbuild/actions/workflows/release.yml) to publish packages to npm.
4. Generate the [release notes](https://github.com/web-infra-dev/rsbuild/releases) via GitHub, see [Automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes)
5. Merge the release pull request to `main`.
1 change: 1 addition & 0 deletions scripts/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ mtsx
napi
nodenext
nolyfill
npmjs
ntqry
onclosetag
onopentag
Expand Down
Loading