-
Notifications
You must be signed in to change notification settings - Fork 222
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·50 lines (41 loc) · 1.19 KB
/
release.sh
File metadata and controls
executable file
·50 lines (41 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Check if an argument is provided
if [ $# -eq 0 ]; then
echo "USAGE: ./release.sh <version_number>"
exit 1
fi
# check if jq is installed
if ! command -v jq &> /dev/null; then
echo "jq could not be found. Please install it."
exit 1
fi
# # Check if the argument is valid
# if [ "$1" != "patch" ] && [ "$1" != "minor" ]; then
# echo "Error: Invalid argument. Please use 'patch' or 'minor'."
# exit 1
# fi
git checkout main
git pull
# # Update versions in apps
# for dir in apps/*/; do
# cd "$dir" || exit
# pnpm version "$1" --no-git-tag-version --yes
# cd - > /dev/null || exit
# done
# # Update versions in packages
# for dir in packages/*/; do
# cd "$dir" || exit
# pnpm version "$1" --no-git-tag-version --yes
# cd - > /dev/null || exit
# done
# # get the new version
# VERSION=$(grep -m1 '"version":' apps/web/package.json | cut -d'"' -f4)
VERSION=$1
# Update version in apps/web/package.json
jq --arg version "$VERSION" '.version = $version' apps/web/package.json > tmp.json && mv tmp.json apps/web/package.json
# commit, tag and push
git add .
git commit -m v$VERSION
git push
git tag -a "v${VERSION}" -m "v${VERSION}"
git push origin --tags