def METHOD_NAME(branch: str, tag: Optional[str]) -> Optional[str]:
    re_match = re.search("^blender-v(.*)-release$", branch)
    release_version = None
    if re_match:
        release_version = re_match.group(1)
    elif tag:
        re_match = re.search(r"^v([0-9]*\.[0-9]*).*", tag)
        if re_match:
            release_version = re_match.group(1)
    return release_version