Skip to content

Commit

Permalink
Merge pull request #675 from CosmWasm/update_changelog-add-upcoming
Browse files Browse the repository at this point in the history
Update changelog add upcoming
  • Loading branch information
maurolacy authored Mar 9, 2022
2 parents a76bbea + 160fb06 commit 2fe1f9d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 15 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## [Unreleased](https://github.com/CosmWasm/cw-plus/tree/HEAD)

[Full Changelog](https://github.com/CosmWasm/cw-plus/compare/v0.13.0...HEAD)

## [v0.13.0](https://github.com/CosmWasm/cw-plus/tree/v0.13.0) (2022-03-09)

[Full Changelog](https://github.com/CosmWasm/cw-plus/compare/v0.12.1...HEAD)
[Full Changelog](https://github.com/CosmWasm/cw-plus/compare/v0.12.1...0.13.0)

**Breaking changes:**

Expand Down
13 changes: 12 additions & 1 deletion scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail
command -v shellcheck > /dev/null && shellcheck "$0"
command -v shellcheck >/dev/null && shellcheck "$0"

function print_usage() {
echo "Usage: $0 [-h|--help]"
echo "Publishes crates to crates.io."
}

if [ "$1" = "-h" ] || [ "$1" = "--help" ]
then
print_usage
exit 1
fi

# this should really more to cosmwasm...
STORAGE_PACKAGES="storage-plus"
Expand Down
10 changes: 5 additions & 5 deletions scripts/set_version.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail
command -v shellcheck > /dev/null && shellcheck "$0"
command -v shellcheck >/dev/null && shellcheck "$0"

function print_usage() {
echo "Usage: $0 NEW_VERSION"
echo ""
echo "e.g. $0 0.8.0"
echo "Usage: $0 [-h|--help] <new_version>"
echo "e.g.: $0 0.8.0"
}

if [ "$#" -ne 1 ]; then
if [ "$#" -ne 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]
then
print_usage
exit 1
fi
Expand Down
38 changes: 30 additions & 8 deletions scripts/update_changelog.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
#!/bin/bash

set -o errexit -o pipefail

ORIGINAL_OPTS=$*
OPTS=$(getopt -l "help,since-tag:,full,token:" -o "hft" -- "$@") || exit 1
OPTS=$(getopt -l "help,since-tag:,upcoming-tag:,full,token:" -o "hu:ft" -- "$@") || exit 1

function print_usage() {
echo -e "Usage: $0 [-h|--help] [-f|--full] [--since-tag <tag>] [-u|--upcoming-tag] <tag> [-t|--token <token>]
-h, --help Display help
-f, --full Process changes since the beginning (by default: since latest git version tag)
--since-tag <tag> Process changes since git version tag <tag> (by default: since latest git version tag)
-u, --upcoming-tag <tag> Add a <tag> title in CHANGELOG for the new changes
--token <token> Pass changelog github token <token>"
}

function remove_opt() {
ORIGINAL_OPTS=$(echo "$ORIGINAL_OPTS" | sed "s/\\B$1\\b//")
}

eval set -- "$OPTS"
while true
do
case $1 in
-h|--help)
echo -e "Usage: $0 [-h|--help] [-f|--full] [--since-tag <tag>] [-t|--token <token>]
-h, --help Display help
-f, --full Process changes since the beginning (by default: since latest git version tag)
--since-tag <tag> Process changes since git version tag <tag> (by default: since latest git version tag)
--token <token> Pass changelog github token <token>"
print_usage
exit 0
;;
--since-tag)
Expand All @@ -22,7 +31,13 @@ case $1 in
;;
-f|--full)
TAG="<FULL>"
ORIGINAL_OPTS=$(echo "$ORIGINAL_OPTS" | sed "s/\\B$1\\b//")
remove_opt $1
;;
-u|--upcoming-tag)
remove_opt $1
shift
UPCOMING_TAG="$1"
remove_opt $1
;;
--)
shift
Expand Down Expand Up @@ -50,4 +65,11 @@ sed -i -n "/^## \\[${TAG}[^]]*\\]/,\$p" CHANGELOG.md

github_changelog_generator -u CosmWasm -p cw-plus --base CHANGELOG.md $ORIGINAL_OPTS || cp /tmp/CHANGELOG.md.$$ CHANGELOG.md

if [ -n "$UPCOMING_TAG" ]
then
# Add "upcoming" version tag
TODAY=$(date "+%Y-%m-%d")
sed -i "s+\[Full Changelog\](https://github.com/CosmWasm/cw-plus/compare/\(.*\)\.\.\.HEAD)+[Full Changelog](https://github.com/CosmWasm/cw-plus/compare/$UPCOMING_TAG...HEAD)\n\n## [$UPCOMING_TAG](https://github.com/CosmWasm/cw-plus/tree/$UPCOMING_TAG) ($TODAY)\n\n[Full Changelog](https://github.com/CosmWasm/cw-plus/compare/\1...$UPCOMING_TAG)+" CHANGELOG.md
fi

rm -f /tmp/CHANGELOG.md.$$

0 comments on commit 2fe1f9d

Please sign in to comment.