httprunner/scripts/bump_version.sh

31 lines
707 B
Bash
Raw Permalink Normal View History

2022-03-23 10:36:24 +08:00
#!/bin/bash
# build hrp cli binary for testing
# release will be triggered on github actions, see .github/workflows/release.yml
# Usage:
2022-09-21 17:50:08 +08:00
# $ make bump version=v4.3.0
2022-03-23 10:36:24 +08:00
# or
2022-09-21 17:50:08 +08:00
# $ bash scripts/bump_version.sh v4.3.0
2022-03-23 10:36:24 +08:00
set -e
version=$1
if [ -z "$version" ]; then
echo "version is required"
exit 1
fi
if [[ $version != v* ]]; then
version="v$version"
fi
2022-03-23 10:36:24 +08:00
echo "bump hrp version to $version"
echo -n "$version" > hrp/internal/version/VERSION
2022-03-23 10:36:24 +08:00
echo "bump httprunner version to $version"
sed -i'.bak' "s/__version__ = \".*\"/__version__ = \"$version\"/g" httprunner/__init__.py
echo "bump pyproject.toml version to $version"
sed -i'.bak' "s/^version = \".*\"/version = \"$version\"/g" pyproject.toml