Skip to content

Commit

Permalink
tooling: add version bumping script
Browse files Browse the repository at this point in the history
  • Loading branch information
sdaqo committed May 16, 2024
1 parent e437410 commit 57eec45
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ polish = ["lint-fix", "format", "lint"]
docs-serve = "mkdocs serve -w api/src"
docs-build = "mkdocs build"
docs-publish = "mkdocs gh-deploy --force"
bump-version = "./scripts/bump_version.sh"
# test = ""

[tool.docformatter]
Expand Down
22 changes: 22 additions & 0 deletions scripts/bump_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

if [ $# -ne 1 ]; then
echo "Usage: $0 <version>"
exit 1
fi

version=$1

update_version() {
local file_path=$1
local version=$2

sed -i -e "s/__version__ = \"[^\"]*\"/__version__ = \"$version\"/" \
-e "s/version = \"[^\"]*\"/version = \"$version\"/" "$file_path"
}

update_version "cli/pyproject.toml" "$version"
update_version "api/pyproject.toml" "$version"
update_version "cli/src/anipy_cli/__init__.py" "$version"
update_version "api/src/anipy_api/__init__.py" "$version"

0 comments on commit 57eec45

Please sign in to comment.