Skip to content

Commit 17bd37a

Browse files
authored
Merge pull request #4859 from doitian/fix-release-scripts
fix release scripts
2 parents 6bba82e + 19787ab commit 17bd37a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

devtools/release/bump.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ main() {
1212
local v="$1"
1313
find . -name 'Cargo.toml' -print0 | xargs -0 sed -i.bak \
1414
-e 's/^version = .*/version = "'"$v"'"/' \
15-
-e 's/\({.*path = ".*",.* version = "= \)[^"]*/\1'"$v"'/'
15+
-e 's/\({.*path = ".*",.* version = "= \?\)[^"]*/\1'"$v"'/'
1616
find . -name 'Cargo.toml.bak' -exec rm -f {} \;
1717
sed -i.bak 's/badge\/version-.*-orange/badge\/version-'"$(echo "$v" | sed s/-/--/g)"'-orange/' README.md
1818
rm -f README.md.bak

devtools/release/release-pkg.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
on_push_pkg() {
44
BRANCH=$(git symbolic-ref --quiet HEAD)
55
BRANCH="${BRANCH#refs/heads/}"
6-
VERSION="v$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml)"
6+
VERSION="v$(sed -n '/^version = "\(.*\)"/{s//\1/p;q}' Cargo.toml)"
77
echo "$BRANCH -> upstream/$BRANCH"
88
echo "$BRANCH -> upstream/pkg/$VERSION"
99

1010
git push upstream "$BRANCH" "$BRANCH:pkg/$VERSION"
1111
}
1212

1313
on_tag() {
14-
VERSION="v$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml)"
14+
VERSION="v$(sed -n '/^version = "\(.*\)"/{s//\1/p;q}' Cargo.toml)"
1515
git tag -s -m "$VERSION" "$VERSION"
1616
}
1717

1818
on_push_tag() {
19-
VERSION="v$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml)"
19+
VERSION="v$(sed -n '/^version = "\(.*\)"/{s//\1/p;q}' Cargo.toml)"
2020
git push upstream "$VERSION"
2121
}
2222

0 commit comments

Comments
 (0)