Skip to content

Commit

Permalink
Update tools/publish.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Aug 6, 2022
1 parent fa528f5 commit aa73eb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-hack"
version = "0.5.16" #publish:version
version = "0.5.16"
edition = "2021"
rust-version = "1.56"
license = "Apache-2.0 OR MIT"
Expand Down
10 changes: 6 additions & 4 deletions tools/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ cd "$(dirname "$0")"/..
# USAGE:
# ./tools/publish.sh <VERSION>
#
# Note:
# - This script requires parse-changelog <https://github.com/taiki-e/parse-changelog>
# Note: This script requires the following tools:
# - parse-changelog <https://github.com/taiki-e/parse-changelog>
# - cargo-workspaces <https://github.com/pksunkara/cargo-workspaces>

x() {
local cmd="$1"
Expand Down Expand Up @@ -98,12 +99,13 @@ for id in $(jq <<<"${metadata}" '.workspace_members[]'); do
bail "publishable workspace members must be version '${prev_version}', but package '${name}' is version '${actual_version}'"
fi

# Update version.
manifest_path=$(jq <<<"${pkg}" -r '.manifest_path')
manifest_paths+=("${manifest_path}")
sed -i -e "s/version = \"${prev_version}\" #publish:version/version = \"${version}\" #publish:version/g" "${manifest_path}"
done

# Update version.
x cargo workspaces version --force '*' --no-git-commit --exact -y custom "${version}"

if [[ -n "${tags}" ]]; then
# Create a release commit.
x git add CHANGELOG.md "${manifest_paths[@]}"
Expand Down

0 comments on commit aa73eb8

Please sign in to comment.