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: init release workflow #86

Merged
merged 3 commits into from
Aug 14, 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
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
Timeless0911 marked this conversation as resolved.
Show resolved Hide resolved
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": false,
"commit": false,
"linked": [],
"access": "restricted",
"baseBranch": "main",
"fixed": [["@rslib/*", "rsbuild-plugin-dts"]],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true,
"updateInternalDependents": "always"
},
"updateInternalDependencies": "patch",
"ignore": []
}
53 changes: 53 additions & 0 deletions .github/workflows/release-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release Pull Request

on:
workflow_dispatch:
inputs:
version:
type: choice
description: 'Release Type (next, beta, alpha, latest)'
required: true
default: 'latest'
options:
- next
- beta
- alpha
- latest

jobs:
release:
name: Create Release Pull Request
runs-on: ubuntu-latest
if: github.repository == 'web-infra-dev/rslib'
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch only one branch to release
fetch-depth: 10

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install --ignore-scripts

- name: Create Release Pull Request
uses: web-infra-dev/actions@v2
with:
# this expects you to have a script called release which does a build for your packages and calls changeset publish
version: ${{ github.event.inputs.version || 'latest' }}
versionNumber: 'auto'
type: 'pull request'
tools: 'changeset'
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
REPOSITORY: ${{ github.repository }}
REF: ${{ github.ref }}
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
type: choice
description: 'Release Version (next, beta, alpha, latest)'
required: true
default: 'next'
options:
- next
- beta
- alpha
- latest
branch:
description: 'Release Branch (confirm release branch)'
required: true
default: 'main'
issue_comment:
types: [created]

permissions:
id-token: write

jobs:
release:
name: Release
if: github.repository == 'web-infra-dev/rslib' && github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 25

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'pnpm'

- 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'
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
REPOSITORY: ${{ github.repository }}
REF: ${{ github.ref }}
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,23 @@ 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).
2. [Run the release action](https://github.com/web-infra-dev/rslib/actions/workflows/release.yml).
3. [Generate the release notes](https://github.com/web-infra-dev/rslib/releases).
4. Merge the release pull request.

## Caveats

The project is still in its early stages and under active development, so it possible dependents on Rsbuild or Rspack canary versions to test the latest features. The current canary versions are:
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"name": "rslib-monorepo",
"private": true,
"workspaces": {
"packages": [
"packages/*"
]
},
"scripts": {
"build": "cross-env NX_DAEMON=false nx run-many -t build --exclude @examples/* --parallel=10",
"build:examples": "cross-env NX_DAEMON=false nx run-many -t build --projects @examples/* --parallel=10",
"change": "changeset",
"check-dependency-version": "check-dependency-version-consistency .",
"check-spell": "npx cspell",
"lint": "biome check . --diagnostic-level=warn && pnpm run check-spell",
Expand All @@ -29,6 +35,7 @@
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@changesets/cli": "^2.27.7",
"@modern-js/module-tools": "^2.55.0",
"@types/fs-extra": "^11.0.4",
"@types/node": "~18.19.39",
Expand Down
19 changes: 19 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<picture>
<img alt="Rslib Banner" src="https://assets.rspack.dev/rslib/rslib-banner.png">
</picture>

# Rslib

Rslib is a library build tool powered by [Rsbuild](https://rsbuild.dev). It allows library developers to leverage the knowledge and ecosystem of webpack and Rspack.

<!-- ## Documentation

https://rslib.dev/ -->

## Contributing

Please read the [Contributing Guide](https://github.com/web-infra-dev/rslib/blob/main/CONTRIBUTING.md).

## License

Rslib is [MIT licensed](https://github.com/web-infra-dev/rslib/blob/main/LICENSE).
19 changes: 19 additions & 0 deletions packages/plugin-dts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<picture>
<img alt="Rslib Banner" src="https://assets.rspack.dev/rslib/rslib-banner.png">
</picture>

# Rslib

Rslib is a library build tool powered by [Rsbuild](https://rsbuild.dev). It allows library developers to leverage the knowledge and ecosystem of webpack and Rspack.

<!-- ## Documentation

https://rslib.dev/ -->

## Contributing

Please read the [Contributing Guide](https://github.com/web-infra-dev/rslib/blob/main/CONTRIBUTING.md).

## License

Rslib is [MIT licensed](https://github.com/web-infra-dev/rslib/blob/main/LICENSE).
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading