Skip to content

Commit

Permalink
Merge branch 'morosi-version' into 'master'
Browse files Browse the repository at this point in the history
Fix build_wheel tag and versioning

See merge request it/e3-aws!24
  • Loading branch information
adanaja committed Dec 6, 2024
2 parents 666df8f + 144e92e commit 9aace23
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions build_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def main() -> None:
)
if not match:
logger.error(
"Expected v<major>.<minor>.<path>(-<commits>)? "
"Expected v<major>.<minor>.<patch>(-<commits>)? "
f"format for tag {tagged_version}"
)
sys.exit(1)
Expand All @@ -112,14 +112,17 @@ def main() -> None:
)
)

# Tag the commit with <major>.<minor>.0 in case of version change.
# Don't tag if there's already a tag (tagged_version_commits is None)
if (
main.args.update
and tagged_version_commits is not None
and version != tagged_version
):
run(["git", "tag", f"v{version}.0"])
# Set patch version to 0 and tag the commit with <major>.<minor>.0 in case of
# version change. If tagged_version_commits is None then the current commit
# is already tagged and the patch version must be set to 0 too
if tagged_version_commits is None or version != tagged_version:
version_patch = 0

# Don't recreate the tag if tagged_version_commits is None
if tagged_version_commits is not None and main.args.update:
tag = f"v{version}.0"
run(["git", "tag", tag])
run(["git", "push", "origin", tag])

# Replace dev1 in the version file.
logger.info(f"Set version to {version}.{version_patch}")
Expand Down

0 comments on commit 9aace23

Please sign in to comment.