Skip to content

Commit 6e46116

Browse files
authored
Merge pull request #11 from sjsjsj1246/codex/setup-changesets
[-]: changesets 릴리즈 파이프라인 추가
2 parents 6502d17 + c2adfd8 commit 6e46116

8 files changed

Lines changed: 611 additions & 884 deletions

File tree

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets).
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).

.changeset/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.3/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": [
11+
"@react-tutorial-overlay/document",
12+
"@react-tutorial-overlay/main"
13+
]
14+
}

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Install pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 10.12.4
26+
27+
- name: Use Node.js 20
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 20
31+
cache: pnpm
32+
registry-url: https://registry.npmjs.org
33+
34+
- name: Install dependencies
35+
run: pnpm install --frozen-lockfile
36+
37+
- name: Create release PR or publish to npm
38+
uses: changesets/action@v1
39+
with:
40+
version: pnpm version-packages
41+
publish: pnpm release
42+
title: "[-]: version packages"
43+
commit: "[-]: version packages"
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,17 @@ Mount `<TutorialOverlay />` once near the root of your app, then trigger `tutori
123123
## Documentation
124124

125125
- [Docs](https://react-tutorial-overlay.vercel.app/docs)
126+
- [Release Guide](./docs/releasing.md)
127+
128+
## Releasing
129+
130+
This repo uses Changesets for versioning and changelog generation.
131+
132+
```bash
133+
pnpm changeset
134+
```
135+
136+
Add a changeset in feature PRs when the published package should change. After merge to `main`, the Release workflow opens or updates a version PR. Merging that PR updates `CHANGELOG.md` and publishes the next npm version.
126137

127138
## Contributing
128139

docs/releasing.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Releasing
2+
3+
This repository now uses [Changesets](https://github.com/changesets/changesets) for versioning, changelog generation, and npm publishing.
4+
5+
## One-time setup
6+
7+
The GitHub release workflow expects an `NPM_TOKEN` repository secret with publish access to the `react-tutorial-overlay` npm package.
8+
9+
## Everyday workflow
10+
11+
1. Make your code change on a feature branch.
12+
2. Add a changeset before opening or updating the PR.
13+
3. Merge the PR into `main`.
14+
4. Let the Release workflow open or update the version PR.
15+
5. Merge the version PR to publish the new npm version and update `CHANGELOG.md`.
16+
17+
## Adding a changeset
18+
19+
Run:
20+
21+
```bash
22+
pnpm changeset
23+
```
24+
25+
When prompted:
26+
27+
- Select `react-tutorial-overlay`
28+
- Pick the appropriate bump type (`patch`, `minor`, or `major`)
29+
- Write a short, user-facing summary
30+
31+
This creates a markdown file in `.changeset/`. Commit that file with the feature change.
32+
33+
## Useful commands
34+
35+
Create a changeset:
36+
37+
```bash
38+
pnpm changeset
39+
```
40+
41+
Preview versioning locally:
42+
43+
```bash
44+
pnpm version-packages
45+
```
46+
47+
Run the full release verification locally:
48+
49+
```bash
50+
pnpm release:verify
51+
```
52+
53+
Publish locally if you really need to:
54+
55+
```bash
56+
pnpm release
57+
```
58+
59+
The normal path should be the GitHub Release workflow instead of local publishing.
60+
61+
## What the release workflow does
62+
63+
On pushes to `main` or manual dispatch, `.github/workflows/release.yml` runs `changesets/action`.
64+
65+
- If unreleased changesets exist, it opens or updates a release PR.
66+
- If the release PR has already been merged and version files are on `main`, it runs `pnpm release`.
67+
- `pnpm release` verifies tests, docs lint/build, size limits, and then runs `changeset publish`.
68+
69+
## Notes for this repo
70+
71+
- Only the root `react-tutorial-overlay` package is versioned and published.
72+
- `packages/document` and `packages/main` are ignored by Changesets.
73+
- `CHANGELOG.md` is updated by `changeset version` through the release PR flow.

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@
99
"main": "pnpm -F @react-tutorial-overlay/main",
1010
"document": "pnpm -F @react-tutorial-overlay/document",
1111
"dev": "pnpm -r dev",
12+
"changeset": "changeset",
13+
"version-packages": "changeset version",
14+
"release:verify": "pnpm -C packages/main test && pnpm -C packages/document lint && pnpm -C packages/document build && pnpm size",
1215
"size": "pnpm main build && size-limit",
1316
"build": "pnpm size",
14-
"docs": "pnpm document build"
17+
"docs": "pnpm document build",
18+
"release": "pnpm release:verify && changeset publish"
1519
},
1620
"keywords": [
1721
"react",
@@ -22,6 +26,9 @@
2226
"files": [
2327
"dist"
2428
],
29+
"publishConfig": {
30+
"access": "public"
31+
},
2532
"size-limit": [
2633
{
2734
"path": "dist/index.js",
@@ -38,8 +45,8 @@
3845
"react-dom": "^18.2.0"
3946
},
4047
"devDependencies": {
48+
"@changesets/cli": "^2.30.0",
4149
"@size-limit/preset-small-lib": "^7.0.8",
42-
"size-limit": "^7.0.8",
43-
"standard-version": "^9.5.0"
50+
"size-limit": "^7.0.8"
4451
}
4552
}

packages/main/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "@react-tutorial-overlay/main",
3+
"private": true,
34
"scripts": {
45
"dev": "tsup --watch",
56
"build": "tsup",

0 commit comments

Comments
 (0)