forked from sonos/tract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·55 lines (44 loc) · 1.24 KB
/
release.sh
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
#!/bin/bash
set -e
git pull # make sure we are in sync
git push
cargo install tomato-toml
CRATE_PATH=$1
VERSION=$2
ALL_CRATES_PATH="data linalg core nnef nnef/nnef-resources pulse-opl pulse extra hir tflite tensorflow onnx-opl onnx libcli api api/rs api/ffi api/proxy/sys api/proxy cli"
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
cargo publish --allow-dirty -p $crate
for other_cargo_toml in `find . -name Cargo.toml \! -path "./target/*" \! -path "./issue*"`
do
if tomato get dependencies.$crate $other_cargo_toml | grep .
then
tomato set "dependencies.$crate.version" "=$VERSION" $other_cargo_toml
fi
if tomato get dev-dependencies.$crate $other_cargo_toml | grep .
then
tomato set "dev-dependencies.$crate.version" "=$VERSION" $other_cargo_toml
fi
done
cargo update
if [ "$CRATE_PATH" = "cli" ]
then
git commit -m "release $VERSION" .
git tag -f v"$VERSION"
git push -f --tags
fi