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: use changeset for changelog #10

Merged
merged 8 commits into from
Nov 5, 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
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 }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个有配了或者需要配吗?刚看了下 https://github.com/umijs/tnf/settings/secrets/actions 没有这个值。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认有这个值,我上次也找了很久

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",
xiaohuoni marked this conversation as resolved.
Show resolved Hide resolved
"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
Loading