Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243#!/bin/sh
IMAGE=$1OLD_VERSION=$2VERSION=$3
command -v git-cliff >/dev/null 2>&1 || { echo >&2 "This script uses https://github.com/orhun/git-cliff, but it is not installed. Aborting."; exit 1; }command -v gh >/dev/null 2>&1 || { echo >&2 "This script uses https://cli.github.com/, but it is not installed. Aborting."; exit 1; }GH_PAGER="" gh release list >/dev/null 2>&1 || { echo >&2 "The GitHub cli is not configured. Aborting."; exit 1; }
git checkout maingit pull
git-cliff --tag=${VERSION} --strip=header ${OLD_VERSION}.. > .tmp.release_infogit-cliff -o --tag=${VERSION} --strip=header
sed -i -e "s/^version = \"${OLD_VERSION}\"/version = \"${VERSION}\"/" Cargo.toml
cargo build
git add Cargo.lock Cargo.toml CHANGELOG.md
git commit -m "release: ${VERSION}" -s
git tag -a "${VERSION}" -F .tmp.release_info
git pushgit push --tags
gh release create --verify-tag -F .tmp.release_info -t "${VERSION}" ${VERSION}
git pull
git checkout ${VERSION}
docker build --progress=plain -t "${IMAGE}:${VERSION}" .
if test -f "create-release-post.sh"; then sh create-release-post.sh "${IMAGE}" "${OLD_VERSION}" "${VERSION}"fi
git checkout main