Skip to content

Commit 35379e4

Browse files
bug: fix publish step missing script (#149)
1 parent cc28fc8 commit 35379e4

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
err() {
5+
echo -e "\e[31m\e[1merror:\e[0m $@" 1>&2;
6+
}
7+
8+
status() {
9+
WIDTH=12
10+
printf "\e[32m\e[1m%${WIDTH}s\e[0m %s\n" "$1" "$2"
11+
}
12+
13+
REF=$1
14+
MANIFEST=$2
15+
16+
if [ -z "$REF" ]; then
17+
err "Expected ref to be set"
18+
exit 1
19+
fi
20+
21+
if [ -z "$MANIFEST" ]; then
22+
err "Expected manifest to be set"
23+
exit 1
24+
fi
25+
26+
# strip preceding 'v' if it exists on tag
27+
REF=${REF/#v}
28+
TOML_VERSION=$(cat $MANIFEST | dasel -r toml -w plain 'workspace.package.version')
29+
30+
if [ "$TOML_VERSION" != "$REF" ]; then
31+
err "Crate version $TOML_VERSION, doesn't match tag version $REF"
32+
exit 1
33+
else
34+
status "Crate version matches tag $TOML_VERSION"
35+
fi

0 commit comments

Comments
 (0)