File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ for workspace_member in $(cargo get --delimiter " " workspace.members); do
11
11
fi
12
12
13
13
package_version=$( cargo get --entry " $workspace_member " package.version)
14
- cratesio_version=$( cargo search " $package_name " | sed -n ' s/' $package_name ' = "\([^"]*\)".*/\1/p' )
15
14
16
- # if local version is different from crates.io version, then publish to crates.io
17
- if [ " $package_version " != " $cratesio_version " ]; then
18
- echo " Local version of $package_name is $package_version , while the one on crates.io is $cratesio_version "
15
+ # if local version not present on crates.io, publish it
16
+ crates_io_url=" https://crates.io/api/v1/crates/$package_name "
17
+ if ! curl -sSLf " $crates_io_url " | jq -r ' .versions[].num' | grep -q " ^$package_version $" ; then
18
+ echo " The local version of $package_name is $package_version , which is not present on crates.io"
19
19
20
20
cargo login " $CRATES_IO_API_KEY "
21
21
cargo publish -p " $package_name "
You can’t perform that action at this time.
0 commit comments