-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.sh
executable file
·52 lines (47 loc) · 2.63 KB
/
publish.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
#!/usr/bin/env bash
#==============================================================================
# Utility script for publishing crates of Decision Toolkit project
#==============================================================================
# Number of the version to be published.
PUBLISHED_VERSION=""
publish() {
echo "┌─────────────────────────────────────────────────────────────────────"
echo "│ Publishing $1 ($3/18) "
echo "└─────────────────────────────────────────────────────────────────────"
cargo update
cd "$1" && cargo publish && cd ..
if [ "$1" != "dsntk" ]; then
sed -i -E "s/$2 = .+/$2 = \"$PUBLISHED_VERSION\"/g" Cargo.toml
fi
echo "┌─────────────────────────────────────────────────────────────────────"
echo "│ Published $1 ($3/18) "
echo "└─────────────────────────────────────────────────────────────────────"
echo "sleeping 10s..."
sleep 10s
}
publish_all() {
publish "examples" "dsntk-examples" 1
publish "macros" "dsntk-macros" 2
publish "common" "dsntk-common" 3
publish "feel-regex" "dsntk-feel-regex" 4
publish "feel-number" "dsntk-feel-number" 5
publish "feel-temporal" "dsntk-feel-temporal" 6
publish "feel-grammar" "dsntk-feel-grammar" 7
publish "feel" "dsntk-feel" 8
publish "feel-parser" "dsntk-feel-parser" 9
publish "feel-evaluator" "dsntk-feel-evaluator" 10
publish "recognizer" "dsntk-recognizer" 11
publish "model" "dsntk-model" 12
publish "model-evaluator" "dsntk-model-evaluator" 13
publish "evaluator" "dsntk-evaluator" 14
publish "gendoc" "dsntk-gendoc" 15
publish "workspace" "dsntk-workspace" 16
publish "server" "dsntk-server" 17
publish "dsntk" "dsntk" 18
}
if [ -z "$PUBLISHED_VERSION" ]; then
echo "Set the publish version variable."
exit 1;
else
publish_all
fi