Skip to content

Commit b57685d

Browse files
authored
ci: setup chanegsets action (#94)
Added GitHub Actions workflow for automated releases using Changesets. - Created a new GitHub Actions workflow file (`.github/workflows/release.yaml`) that: - Runs on pushes to the main branch - Sets up Node.js v22 with pnpm - Uses the Changesets Action to either create a release PR or publish to npm - Added a new `ci:publish` script to `package.json` that builds the project and publishes using Changesets This automation streamlines the release process by using GitHub Actions and Changesets to handle versioning and publishing. It reduces manual steps in the release process and ensures consistent releases with proper version bumps based on the changesets.
1 parent 9089cb3 commit b57685d

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.github/workflows/release.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
9+
jobs:
10+
version:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 1
17+
18+
- name: Install pnpm
19+
uses: pnpm/action-setup@v4
20+
21+
- name: Setup node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
cache: "pnpm"
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+
publish: pnpm ci:release
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"check": "pnpm --filter react-shiki check",
1717
"format": "pnpm --filter react-shiki format",
1818
"changeset": "changeset",
19-
"release": "node scripts/release.mjs"
19+
"release": "node scripts/release.mjs",
20+
"ci:publish": "pnpm build && changeset publish"
2021
},
2122
"devDependencies": {
2223
"@biomejs/biome": "^1.9.4",

0 commit comments

Comments
 (0)