aboutsummaryrefslogtreecommitdiffstats
path: root/utils/bump-version.sh
blob: 408e5858b85d43d5085101d45ee77e3736785b12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#|/usr/bin/env sh

set -e

script_dir=$(dirname -- "$(readlink -f "$0")")
root_dir=$script_dir/..

cwd=$(pwd)
cd "$root_dir"

version=$(head -n 1 docs/CHANGELOG.md | cut -f 1 -d ' ')

sed -i -E 's/^version = .+$/version = "'"$version"'"/' Cargo.toml
cargo build
git add Cargo.toml Cargo.lock docs/CHANGELOG.md
git commit -m "Bump to v$version"
git tag -a v"$version" -m "$(utils/generate_changelog.sh)"

git push
git push mandibles
cargo publish

cd "$cwd"