aboutsummaryrefslogtreecommitdiffstats
path: root/release
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2018-06-16 15:09:34 +1200
committerAldo Cortesi <aldo@nullcube.com>2018-06-16 15:09:34 +1200
commit9463fee76488c41dcce995999dd98c190000ded6 (patch)
tree9c18fc716e4e88993c7d6134ca1565ac9e2a2e55 /release
parent94a22b87954af42d552d2d94a845e764df0d4587 (diff)
downloadmitmproxy-9463fee76488c41dcce995999dd98c190000ded6.tar.gz
mitmproxy-9463fee76488c41dcce995999dd98c190000ded6.tar.bz2
mitmproxy-9463fee76488c41dcce995999dd98c190000ded6.zip
cibuild: permit non-dev versions on maintenance branches
Cater for the corner case where commits are incorporated on a maintenance branch. We should be able to test these without adding a dev suffix to the tool versions.
Diffstat (limited to 'release')
-rwxr-xr-xrelease/cibuild.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/release/cibuild.py b/release/cibuild.py
index 76eb377e..37511086 100755
--- a/release/cibuild.py
+++ b/release/cibuild.py
@@ -196,13 +196,25 @@ class BuildEnviron:
# For production releases, we require strict version equality
if self.version != version:
raise ValueError(f"Tag is {self.tag}, but mitmproxy/version.py is {version}.")
- else:
- # For snapshots, we only ensure that mitmproxy/version.py contains a dev release.
+ elif not self.is_maintenance_branch:
+ # Commits on maintenance branches don't need the dev suffix. This
+ # allows us to incorporate and test commits between tagged releases.
+ # For snapshots, we only ensure that mitmproxy/version.py contains a
+ # dev release.
version_info = parver.Version.parse(version)
if not version_info.is_devrelease:
raise ValueError(f"Non-production releases must have dev suffix: {version}")
@property
+ def is_maintenance_branch(self) -> bool:
+ """
+ Is this an untagged commit on a maintenance branch?
+ """
+ if not self.tag and self.branch and re.match(r"v\d+\.x", self.branch):
+ return True
+ return False
+
+ @property
def has_docker_creds(self) -> bool:
return bool(self.docker_username and self.docker_password)