Skip to content

Commit

Permalink
chore: use changeset for changelog (#10)
Browse files Browse the repository at this point in the history
* feat: changeset

* chore: change log

* chore: code style

* docs: changeset

* chore: code style

* Update CONTRIBUTING.md

* Update .changeset/angry-scissors-double.md

---------

Co-authored-by: chencheng (云谦) <[email protected]>
  • Loading branch information
xiaohuoni and sorrycc authored Nov 5, 2024
1 parent 7d77a86 commit b3c9f53
Show file tree
Hide file tree
Showing 10 changed files with 716 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
5 changes: 5 additions & 0 deletions .changeset/angry-scissors-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@umijs/tnf': patch
---

chore: use changeset for changelog
19 changes: 19 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "umijs/tnf"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"updateInternalDependents": "always"
},
"ignore": ["@examples/hackernews", "@examples/normal"]
}
5 changes: 5 additions & 0 deletions .changeset/sweet-queens-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@umijs/tnf': patch
---

docs: add changeset usege
32 changes: 32 additions & 0 deletions .github/workflows/changeset-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Changesets

on:
push:
branches:
- master

jobs:
release:
name: upgrade-version
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Use Node.js 20.x
uses: actions/setup-node@v2
with:
node-version: 20.x

- name: Install pnpm
uses: pnpm/[email protected]
with:
run_install: true

- name: Create Release Pull Request
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,29 @@ $ pnpm test --run
$ pnpm test:e2e
```

## Changelog

When you need to submit code, please synchronize the submission of the modification log.

```bash
$ pnpm changeset

🦋 What kind of change is this for @umijs/tnf? (current version is 0.0.0-alpha.5) …
❯ patch
minor
major

🦋 Please enter a summary for this change (this will be in the changelogs).
🦋 (submit empty line to open external editor)
🦋 Summary › docs: changelog

🦋 === Summary of changesets ===
🦋 patch: @umijs/tnf
🦋
🦋 Is this your desired changeset? (Y/n) · true
🦋 Changeset added! - you can now commit it
```
Based on the modified package name, select the type to be published, usually choosing `patch`.Then enter `changelog`.
After the code is merged into the main branch, it will be sent to GitHub CI to automatically change the version number of the corresponding package.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0-alpha.5",
"scripts": {
"build": "father build",
"changeset": "tsx scripts/changeset.ts && changeset",
"check": "prettier --check .",
"ci": "npm run check && npm run build && npm run test --run && npm run test:e2e && father doctor",
"dev": "father dev",
Expand Down Expand Up @@ -56,6 +57,9 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.9",
"@manypkg/get-packages": "^2.2.2",
"@playwright/test": "^1.42.1",
"@total-typescript/tsconfig": "^1.0.4",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
Expand Down
Loading

0 comments on commit b3c9f53

Please sign in to comment.