commit
88bc7844e3
7 files changed
+446
No files matched your search
Executable
+60
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
test_root=$(mktemp -d)
|
||||
trap 'rm -rf "${test_root}"' EXIT
|
||||
|
||||
git init --bare -q "${test_root}/remote.git"
|
||||
git init -q -b main "${test_root}/app"
|
||||
cd "${test_root}/app"
|
||||
git config user.name Test
|
||||
git config user.email test@example.com
|
||||
mkdir erp_operations
|
||||
cat > pyproject.toml <<'TOML'
|
||||
[tool.bumpversion]
|
||||
current_version = "0.0.1"
|
||||
commit = false
|
||||
tag = false
|
||||
|
||||
[[tool.bumpversion.files]]
|
||||
filename = "erp_operations/__init__.py"
|
||||
search = '__version__ = "{current_version}"'
|
||||
replace = '__version__ = "{new_version}"'
|
||||
TOML
|
||||
printf '%s\n' '__version__ = "0.0.1"' > erp_operations/__init__.py
|
||||
git add .
|
||||
git commit -qm initial
|
||||
git remote add origin "${test_root}/remote.git"
|
||||
git push -qu origin main
|
||||
git switch -qc develop
|
||||
git push -qu origin develop
|
||||
|
||||
export INPUT_CONFIG_FILE=pyproject.toml
|
||||
export INPUT_BASE_BRANCH=main
|
||||
export INPUT_TARGET_BRANCH=develop
|
||||
export INPUT_BUMP=patch
|
||||
export INPUT_REMOTE=origin
|
||||
export INPUT_COMMIT_MESSAGE='chore(release): prepare v{version}'
|
||||
export INPUT_GIT_USER_NAME='ERP App Release Bot'
|
||||
export INPUT_GIT_USER_EMAIL='actions@example.com'
|
||||
export INPUT_BUMP_MY_VERSION_VERSION=1.5.1
|
||||
export INPUT_PUSH=true
|
||||
export RUNNER_TEMP="${test_root}"
|
||||
export GITHUB_OUTPUT="${test_root}/output"
|
||||
|
||||
"${repo_root}/scripts/bump.sh"
|
||||
grep -q '^current_version = "0.0.2"$' pyproject.toml
|
||||
grep -q '^__version__ = "0.0.2"$' erp_operations/__init__.py
|
||||
grep -q '^bumped=true$' "${GITHUB_OUTPUT}"
|
||||
grep -q '^previous-version=0.0.1$' "${GITHUB_OUTPUT}"
|
||||
grep -q '^current-version=0.0.2$' "${GITHUB_OUTPUT}"
|
||||
[[ "$(git log -1 --format=%s)" == "chore(release): prepare v0.0.2" ]]
|
||||
[[ "$(git rev-parse HEAD)" == "$(git --git-dir="${test_root}/remote.git" rev-parse develop)" ]]
|
||||
|
||||
: > "${GITHUB_OUTPUT}"
|
||||
"${repo_root}/scripts/bump.sh"
|
||||
grep -q '^bumped=false$' "${GITHUB_OUTPUT}"
|
||||
[[ "$(git rev-list --count main..develop)" == "1" ]]
|
||||
|
||||
echo "Integration test passed"
|
||||
Reference in new issue
Block a user