diff --git a/CHANGELOG.md b/CHANGELOG.md index 7174d96d51..ab17265f9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + ## [Unreleased] ### Added @@ -800,6 +802,8 @@ and this project adheres to The CHANGELOG for versions before 1.0.0 was moved to [CHANGELOG-pre1.0.0.md](./CHANGELOG-pre1.0.0.md). + + [unreleased]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.1...HEAD [2.0.1]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.0...v2.0.1 [2.0.0]: https://github.com/CosmWasm/cosmwasm/compare/v1.5.0...v2.0.0 diff --git a/Cargo.toml b/Cargo.toml index cf914fea53..ef908d1916 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,3 +12,8 @@ version = "2.0.1" [workspace.dependencies] schemars = "0.8.4" serde = { version = "1.0.192", default-features = false, features = ["derive", "alloc"] } + +[workspace.metadata.release] +shared-version = true +tag-message = "chore: Release cosmwasm v{{version}}" +tag-name = "v{{version}}" diff --git a/devtools/release_checks.sh b/devtools/release_checks.sh new file mode 100755 index 0000000000..3a53e932f8 --- /dev/null +++ b/devtools/release_checks.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Move to the workspace root +WORKSPACE_PATH=$(dirname $(cargo locate-project --workspace --message-format=plain)) +cd $WORKSPACE_PATH + +cargo build + +for contract_dir in contracts/*/; do + (cd "$contract_dir" && cargo build) +done diff --git a/devtools/set_version.sh b/devtools/set_version.sh deleted file mode 100755 index 5dd6bc9034..0000000000 --- a/devtools/set_version.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -set -o errexit -o nounset -o pipefail -command -v shellcheck >/dev/null && shellcheck "$0" - -gnused="$(command -v gsed || echo sed)" - -function print_usage() { - echo "Usage: $0 NEW_VERSION" - echo "" - echo "e.g. $0 0.8.0" -} - -if [ "$#" -ne 1 ]; then - print_usage - exit 1 -fi - -# Check repo -SCRIPT_DIR="$(realpath "$(dirname "$0")")" -if [[ "$(realpath "$SCRIPT_DIR/..")" != "$(pwd)" ]]; then - echo "Script must be called from the repo root" - exit 2 -fi - -# Ensure repo is not dirty -CHANGES_IN_REPO=$(git status --porcelain) -if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 3 -fi - -NEW="$1" -OLD=$("$gnused" -n -e 's/^version[[:space:]]*=[[:space:]]*"\(.*\)"/\1/p' packages/std/Cargo.toml) -echo "Updating old version $OLD to new version $NEW ..." - -FILES_MODIFIED=() - -for package_dir in packages/*/; do - CARGO_TOML="$package_dir/Cargo.toml" - # The `version = "1.0.0"` cases - "$gnused" -i -e "s/version[[:space:]]*=[[:space:]]*\"$OLD\"/version = \"$NEW\"/" "$CARGO_TOML" - # The `version = "=1.0.0"` cases - "$gnused" -i -e "s/version[[:space:]]*=[[:space:]]*\"=$OLD\"/version = \"=$NEW\"/" "$CARGO_TOML" - FILES_MODIFIED+=("$CARGO_TOML") -done - -cargo build -FILES_MODIFIED+=("Cargo.lock") - -for contract_dir in contracts/*/; do - CARGO_LOCK="$contract_dir/Cargo.lock" - - (cd "$contract_dir" && cargo build) - - FILES_MODIFIED+=("$CARGO_LOCK") -done - -echo "Staging ${FILES_MODIFIED[*]} ..." -git add "${FILES_MODIFIED[@]}" -git commit -m "Set version: $NEW" diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 24ffa69595..2de1ec3e3f 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -7,6 +7,7 @@ repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/core" license = "Apache-2.0" readme = "README.md" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[package.metadata.release] +release = false [dependencies] diff --git a/packages/go-gen/Cargo.toml b/packages/go-gen/Cargo.toml index 6cc9bf3e6f..a4c82ad8d1 100644 --- a/packages/go-gen/Cargo.toml +++ b/packages/go-gen/Cargo.toml @@ -5,8 +5,6 @@ version = "0.1.0" edition = "2021" publish = false -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] cosmwasm-std = { version = "2.0.1", path = "../std", features = ["cosmwasm_2_0", "staking", "stargate"] } cosmwasm-schema = { version = "2.0.1", path = "../schema" } diff --git a/packages/vm/Cargo.toml b/packages/vm/Cargo.toml index 3a24b5b49c..647b8ae2f3 100644 --- a/packages/vm/Cargo.toml +++ b/packages/vm/Cargo.toml @@ -7,6 +7,18 @@ description = "VM bindings to run cosmwams contracts" repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/vm" license = "Apache-2.0" +[package.metadata.release] +pre-release-hook = [ + "../../devtools/release_checks.sh" +] +pre-release-replacements = [ + { file="../../CHANGELOG.md", search="## \\[Unreleased\\]", replace="## [{{version}}] - {{date}}", exactly=1 }, + { file="../../CHANGELOG.md", search="(U|u)nreleased", replace="{{version}}" }, + { file="../../CHANGELOG.md", search="", replace="\n\n## [Unreleased]", exactly=1 }, + { file="../../CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1 }, + { file="../../CHANGELOG.md", search="\n", replace="\n\n[unreleased]: https://github.com/CosmWasm/cosmwasm/compare/{{tag_name}}...HEAD", exactly=1 }, +] + [features] default = ["staking", "iterator"] # iterator allows us to iterate over all DB items in a given range