-
Notifications
You must be signed in to change notification settings - Fork 253
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·49 lines (38 loc) · 864 Bytes
/
release.sh
File metadata and controls
executable file
·49 lines (38 loc) · 864 Bytes
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
#!/bin/bash
set -e
git pull # make sure we are in sync
git push
which tomato || cargo install tomato-toml
CRATE_PATH=$1
VERSION=$2
. ./.all_crates.sh
if [ -z "$VERSION" ]
then
echo "Usage: $0 <crate> <version>"
echo crates order is: $ALL_CRATES_PATH
exit 1
fi
set -ex
if [ "$CRATE_PATH" = "all" ]
then
for c in $ALL_CRATES_PATH
do
$0 $c $VERSION
done
exit 0
fi
crate=$(tomato get package.name $CRATE_PATH/Cargo.toml)
tomato set package.version $VERSION $CRATE_PATH/Cargo.toml
./.change_crate_dep.sh $crate $VERSION
if [ "$crate" = "tract-metal" -o "$crate" = 'tract-cuda' ]
then
cargo publish -q --allow-dirty --no-verify -p $crate
else
cargo publish -q --allow-dirty -p $crate
fi
if [ "$CRATE_PATH" = "cli" ]
then
git commit -m "release $VERSION" .
git tag -f v"$VERSION"
git push -f --tags
fi