Skip to content

Commit c429879

Browse files
authored
add helper script for bumping shared-core (#444)
1 parent b371a92 commit c429879

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tools/bump-shared-core.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
# Usage: ./tools/bump-shared-core.sh [sha]
6+
# If sha is not provided, it defaults to the latest commit on the main branch of shared-core.
7+
8+
if ! which cargo-upgrade >/dev/null 2>&1; then
9+
echo "cargo-edit is not installed. Please install it with 'cargo install cargo-edit' and make sure that it's in your PATH."
10+
exit 1
11+
fi
12+
13+
shared_core_main=$(git ls-remote [email protected]:bitdriftlabs/shared-core.git main | awk '{print $1}')
14+
sha="${1:-$shared_core_main}"
15+
16+
old_version=$(grep bd-api Cargo.toml | grep -Eo 'rev = ".*"' | cut -d' ' -f3 | tr -d '"')
17+
18+
sed -i "s|\"$old_version\"|\"$sha\"|g" Cargo.toml
19+
20+
cargo upgrade --incompatible

0 commit comments

Comments
 (0)