-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbump.sh
More file actions
executable file
·58 lines (43 loc) · 1.1 KB
/
bump.sh
File metadata and controls
executable file
·58 lines (43 loc) · 1.1 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
51
52
53
54
55
56
57
58
#!/bin/bash
set -e
if ! command -v git-cliff &>/dev/null; then
echo "Error: git-cliff is not installed."
exit 1
fi
if ! command -v gh &>/dev/null; then
echo "Error: GitHub CLI (gh) is not installed."
exit 1
fi
if ! gh auth status &>/dev/null; then
echo "Error: GitHub CLI is not authenticated."
exit 1
fi
if ! command -v cargo &>/dev/null; then
echo "Error: Cargo is not installed."
exit 1
fi
if [ -z "$1" ]; then
echo "Usage: $0 <version>"
exit 1
fi
VERSION="$1"
TAG="v$VERSION"
if sed --version >/dev/null 2>&1; then
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
else
sed -i '' "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
fi
cargo update -p catalyst --precise "$VERSION"
git add Cargo.toml Cargo.lock
git commit -m "Bump version to $VERSION"
git push origin main
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists."
exit 1
fi
git tag "$TAG"
git push origin "$TAG"
NOTES=$(git-cliff --tag "$TAG")
gh release create "$TAG" --title "$TAG" --notes "$NOTES"
cargo doc --no-deps --document-private-items --all-features
cargo publish