this repo has no description
1#!/bin/sh
2
3IMAGE=$1
4OLD_VERSION=$2
5VERSION=$3
6
7command -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; }
8command -v gh >/dev/null 2>&1 || { echo >&2 "This script uses https://cli.github.com/, but it is not installed. Aborting."; exit 1; }
9GH_PAGER="" gh release list >/dev/null 2>&1 || { echo >&2 "The GitHub cli is not configured. Aborting."; exit 1; }
10
11git checkout main
12git pull
13
14git-cliff --tag=${VERSION} --strip=header ${OLD_VERSION}.. > .tmp.release_info
15git-cliff -o --tag=${VERSION} --strip=header
16
17sed -i -e "s/^version = \"${OLD_VERSION}\"/version = \"${VERSION}\"/" Cargo.toml
18
19cargo build
20
21git add Cargo.lock Cargo.toml CHANGELOG.md
22
23git commit -m "release: ${VERSION}" -s
24
25git tag -a "${VERSION}" -F .tmp.release_info
26
27git push
28git push --tags
29
30gh release create --verify-tag -F .tmp.release_info -t "${VERSION}" ${VERSION}
31
32git pull
33
34git checkout ${VERSION}
35
36docker build --progress=plain -t "${IMAGE}:${VERSION}" .
37
38if test -f "create-release-post.sh"; then
39 sh create-release-post.sh "${IMAGE}" "${OLD_VERSION}" "${VERSION}"
40fi
41
42git checkout main