Skip to content

Commit f6a7889

Browse files
ci: Setup Release Process with Changesets (#11)
1 parent fbcce27 commit f6a7889

File tree

5 files changed

+981
-1
lines changed

5 files changed

+981
-1
lines changed

.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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/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+
}

.github/workflows/release.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@v3
15+
with:
16+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
17+
fetch-depth: 0
18+
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
23+
- uses: pnpm/action-setup@v2
24+
with:
25+
version: 8
26+
27+
- name: Install Dependencies
28+
run: pnpm install --frozen-lockfile
29+
30+
- name: Create Release Pull Request or Publish to npm
31+
id: changesets
32+
uses: changesets/action@v1
33+
with:
34+
version: pnpm changeset:version
35+
publish: pnpm changeset:publish
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
],
3636
"scripts": {
3737
"build": "tsup",
38+
"changeset": "changeset && pnpm install",
39+
"changeset:version": "changeset version && pnpm install --lockfile-only",
40+
"changeset:publish": "changeset publish",
3841
"format": "prettier -w src",
3942
"prepare": "husky install",
4043
"publint": "publint",
@@ -51,6 +54,7 @@
5154
"tailwindcss": "^3.3.3"
5255
},
5356
"devDependencies": {
57+
"@changesets/cli": "^2.26.2",
5458
"@storybook/addon-essentials": "^7.3.1",
5559
"@storybook/addon-interactions": "^7.3.1",
5660
"@storybook/addon-links": "^7.3.1",

0 commit comments

Comments
 (0)