Cycle pip wheel cache on dev version bump [CI] (#65791)

This commit is contained in:
Marc Mueller 2022-02-07 00:25:22 +01:00 committed by GitHub
parent fd7e2e76e7
commit 633aad3a60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 7 deletions

View file

@ -131,6 +131,23 @@ def write_version_metadata(version: Version) -> None:
fp.write(content)
def write_ci_workflow(version: Version) -> None:
"""Update ci workflow with new version."""
with open(".github/workflows/ci.yaml") as fp:
content = fp.read()
short_version = ".".join(str(version).split(".", maxsplit=2)[:2])
content = re.sub(
r"(\n\W+HA_SHORT_VERSION: )\d{4}\.\d{1,2}\n",
f"\\g<1>{short_version}\n",
content,
count=1,
)
with open(".github/workflows/ci.yaml", "w") as fp:
fp.write(content)
def main():
"""Execute script."""
parser = argparse.ArgumentParser(description="Bump version of Home Assistant")
@ -154,6 +171,7 @@ def main():
write_version(bumped)
write_version_metadata(bumped)
write_ci_workflow(bumped)
if not arguments.commit:
return