Skip to content

Commit eea18ab

Browse files
author
Rajat Saxena
committed
Added a release script
1 parent 5c68e36 commit eea18ab

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"lint": "eslint --cache --quiet",
2424
"prettier": "prettier --check **/*.{ts,tsx,js,css,md}",
2525
"lint:fix": "eslint --cache --fix",
26-
"prettier:fix": "prettier --write **/*.{ts,tsx,js,css,md}"
26+
"prettier:fix": "prettier --write **/*.{ts,tsx,js,css,md}",
27+
"release": "./release.sh"
2728
},
2829
"lint-staged": {
2930
"*.{ts,tsx}": "eslint --cache --fix **/*.{ts,tsx}",

release.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Check if an argument is provided
4+
if [ $# -eq 0 ]; then
5+
echo "USAGE: ./release.sh <version_number>"
6+
exit 1
7+
fi
8+
9+
# check if jq is installed
10+
if ! command -v jq &> /dev/null; then
11+
echo "jq could not be found. Please install it."
12+
exit 1
13+
fi
14+
15+
VERSION=$1
16+
17+
# Update version in apps/web/package.json
18+
jq --arg version "$VERSION" '.version = $version' apps/api/package.json > tmp.json && mv tmp.json apps/api/package.json
19+
20+
# commit, tag and push
21+
git add .
22+
git commit -m v$VERSION
23+
git push
24+
git tag -a "v${VERSION}" -m "v${VERSION}"
25+
git push origin --tags

0 commit comments

Comments
 (0)