Skip to content

Commit

Permalink
chore(workflow): use changeset CLI as release tools (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Apr 7, 2024
1 parent 63107df commit 0f02abe
Show file tree
Hide file tree
Showing 39 changed files with 144 additions and 10,235 deletions.
8 changes: 3 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
## Summary


## Related Issue

<!--- Provide link of related issues -->

## Checklist

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- Check and mark with an "x" -->

- [ ] I have added changeset via `pnpm run change`.
- [ ] I have updated the documentation.
- [ ] I have added tests to cover my changes.
- [ ] Tests updated (or not required).
- [ ] Documentation updated (or not required).
2 changes: 1 addition & 1 deletion .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
version: nightly
branch: main
type: 'release'
tools: 'modern'
tools: 'changeset'
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-pull-request-with-modernjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
version: ${{ github.event.inputs.version || 'latest' }}
versionNumber: 'auto'
type: 'pull request'
tools: 'modern'
tools: 'changeset'
beforeBumpScript: 'update:modern'
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
version: ${{ github.event.inputs.version || 'latest' }}
versionNumber: 'auto'
type: 'pull request'
tools: 'modern'
tools: 'changeset'
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
version: 'next'
type: 'release'
branch: ''
tools: 'modern'
tools: 'changeset'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
version: ${{ github.event.inputs.version }}
branch: ${{ github.event.inputs.branch }}
type: 'release'
tools: 'modern'
tools: 'changeset'
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
25 changes: 13 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,6 @@ pnpm run lint

## Submitting Changes

### Add a Changeset

Rspress is using [Changesets](https://github.com/changesets/changesets) to manage the versioning and changelogs.

If you've changed some packages, you need add a new changeset for the changes. Please run `change` command to select the changed packages and add the changeset info.

```sh
pnpm run change
```

### Committing your Changes

Commit your changes to your forked repo, and [create a pull request](https://help.github.com/articles/creating-a-pull-request/).
Expand Down Expand Up @@ -223,8 +213,19 @@ Dependencies installation-related metrics base on publishing process, so the dat

---

## Publishing
## Versioning

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

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

We use **Modern.js Monorepo Solution** to manage version and changelog.
## 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/rspress/actions/workflows/release-pull-request.yml).
2. [Run the release action](https://github.com/web-infra-dev/rspress/actions/workflows/release.yml).
3. [Generate the release notes](https://github.com/web-infra-dev/rspress/releases).
4. Merge the release pull request.
14 changes: 3 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@
"private": true,
"name": "monorepo",
"scripts": {
"new": "modern new",
"reset": "modern clear",
"change": "modern change",
"bump": "modern bump",
"pre": "modern pre",
"change": "changeset",
"changeset": "changeset",
"prepare": "npm run build && husky install",
"check-spell": "npx cspell",
"dev": "cross-env NX_DAEMON=false NX_REJECT_UNKNOWN_LOCAL_CACHE=0 nx run-many -t dev --exclude @rspress-fixture/*",
"build": "cross-env NX_DAEMON=false NX_REJECT_UNKNOWN_LOCAL_CACHE=0 nx run-many -t build --exclude @rspress-fixture/*",
"test": "pnpm test:unit && pnpm test:e2e",
"test:unit": "cross-env NX_DAEMON=false NX_REJECT_UNKNOWN_LOCAL_CACHE=0 nx run-many -t test --exclude @rspress-fixture/*",
"test:e2e": "playwright test",
"change-status": "modern change-status",
"gen-release-note": "modern gen-release-note",
"release": "modern release",
"deploy": "modern deploy",
"lint": "biome lint . --diagnostic-level=warn",
"upgrade": "modern upgrade",
"dev:website": "cross-env NX_DAEMON=false NX_REJECT_UNKNOWN_LOCAL_CACHE=0 nx run @rspress/docs:dev",
"build:website": "cross-env NX_DAEMON=false NX_REJECT_UNKNOWN_LOCAL_CACHE=0 nx run @rspress/docs:build",
"preview:website": "cd packages/document && npm run preview",
Expand All @@ -45,10 +37,10 @@
},
"devDependencies": {
"@biomejs/biome": "1.5.3",
"@changesets/cli": "^2.27.1",
"@manypkg/get-packages": "^2.2.0",
"@modern-js/generator-utils": "3.3.15",
"@modern-js/module-tools": "2.48.4",
"@modern-js/monorepo-tools": "2.48.4",
"@modern-js/tsconfig": "2.48.4",
"@playwright/test": "1.33.0",
"@types/cross-spawn": "^6.0.2",
Expand Down
Loading

0 comments on commit 0f02abe

Please sign in to comment.