Skip to content

Commit

Permalink
fix release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Sep 23, 2024
1 parent 73c2815 commit 094cb7d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
7 changes: 7 additions & 0 deletions .change_crate_dep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

crate=$1
version=$2

perl -pi -e "s/^($crate = {.*version *= *)\"([^\"]*)\"(.*)$/\$1\"=$version\"\$3/" \
`find . -name Cargo.toml \! -path "./target/*" \! -path "./issue*"`
11 changes: 1 addition & 10 deletions post-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@ for path in $ALL_CRATES_PATH
do
crate=$(tomato get package.name $path/Cargo.toml)
tomato set package.version $VERSION $path/Cargo.toml > /dev/null
for other_cargo_toml in `find . -name Cargo.toml \! -path "./target/*" \! -path "./issue*"`
do
for prefix in "" "dev-" "build-" 'cfg(any(target_os = \"macos\", target_os = \"ios\"'
do
if tomato get "${prefix}dependencies.$crate" $other_cargo_toml | grep -F . > /dev/null
then
tomato set "${prefix}dependencies.$crate.version" "=$VERSION" $other_cargo_toml > /dev/null
fi
done
done
./.change_crate_dep.sh $crate $VERSION
done

git commit . -m "post-release $VERSION"
Expand Down
11 changes: 1 addition & 10 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,7 @@ else
cargo publish --allow-dirty -p $crate
fi

for other_cargo_toml in `find . -name Cargo.toml \! -path "./target/*" \! -path "./issue*"`
do
for prefix in "" "dev-" "build-"
do
if tomato get "${prefix}dependencies.$crate" $other_cargo_toml | grep .
then
tomato set "${prefix}dependencies.$crate.version" "=$VERSION" $other_cargo_toml
fi
done
done
./.change_crate_dep.sh $crate $VERSION

cargo update

Expand Down

0 comments on commit 094cb7d

Please sign in to comment.