File tree Expand file tree Collapse file tree 2 files changed +45
-1
lines changed
Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Original file line number Diff line number Diff line change 5858 "docs:dev" : " bun run --cwd apps/docs dev" ,
5959 "docs:build" : " bun run --cwd apps/docs build" ,
6060 "prepublishOnly" : " bun run build" ,
61- "prepare" : " husky"
61+ "prepare" : " husky" ,
62+ "release" : " ./scripts/release.sh"
6263 },
6364 "devDependencies" : {
6465 "@biomejs/biome" : " ^2.3.10" ,
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ if [ $# -eq 0 ]; then
5+ echo " Usage: bun run release <version>"
6+ echo " "
7+ echo " Examples:"
8+ echo " bun run release 0.0.1-beta.1"
9+ echo " bun run release patch"
10+ echo " bun run release minor"
11+ echo " bun run release major"
12+ exit 1
13+ fi
14+
15+ VERSION_ARG=" $1 "
16+
17+ # Check for uncommitted changes
18+ if ! git diff --quiet || ! git diff --staged --quiet; then
19+ echo " Error: You have uncommitted changes"
20+ exit 1
21+ fi
22+
23+ echo " Bumping version to $VERSION_ARG ..."
24+ npm version " $VERSION_ARG " --no-git-tag-version
25+
26+ NEW_VERSION=$( node -p " require('./package.json').version" )
27+ TAG=" v$NEW_VERSION "
28+
29+ echo " Committing version bump..."
30+ git add package.json
31+ git commit -m " release: $TAG "
32+
33+ echo " Creating tag $TAG ..."
34+ git tag " $TAG "
35+
36+ echo " Pushing branch and tag to origin..."
37+ git push && git push origin " $TAG "
38+
39+ echo " "
40+ echo " Done! Released $TAG "
41+ echo " GitHub Actions will now:"
42+ echo " 1. Create a GitHub Release"
43+ echo " 2. Publish to npm"
You can’t perform that action at this time.
0 commit comments