forked from sonos/tract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·47 lines (38 loc) · 841 Bytes
/
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
#!/bin/sh
CRATE=$1
VERSION=$2
CRATES="linalg core tensorflow onnx cli"
if [ -z "$VERSION" ]
then
echo "Usage: $0 <crate> <version>"
echo crates order is: $CRATES
exit 1
fi
set -ex
if [ "$CRATE" = "all" ]
then
for c in $CRATES
do
$0 $c $VERSION
done
exit 0
fi
# set_version cargo-dinghy/Cargo.toml 0.3.0
set_version() {
FILE=$1
VERSION=$2
sed -i.back "s/^version *= *\".*\"/version = \"$2\"/" $FILE
for dep in `grep "^tract-" $FILE | cut -d " " -f 1`
do
cargo add --manifest-path $FILE $dep@$VERSION
done
}
cargo update
set_version $CRATE/Cargo.toml $VERSION
(cd $CRATE ; cargo publish --dry-run --allow-dirty)
git commit . -m "release $CRATE/$VERSION"
git tag -f "$CRATE/$VERSION"
git push -f --tags
(cd $CRATE ; cargo publish --allow-dirty)
cargo update
sleep 5