summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-08-16 16:34:03 +0200
committerFlorian Bruhin <me@the-compiler.org>2023-08-17 12:36:25 +0200
commit13ddb50170ed55f63ec3bee618d9c2475252791a (patch)
tree9527b2c577fa6ef456c18e0062a30248b61c6df8 /scripts
parent9757fa79ee9e94d60f521269c675df16c33b79b0 (diff)
downloadqutebrowser-13ddb50170ed55f63ec3bee618d9c2475252791a.tar.gz
qutebrowser-13ddb50170ed55f63ec3bee618d9c2475252791a.zip
ci: More automatic release improvements/fixes
Diffstat (limited to 'scripts')
-rw-r--r--scripts/dev/update_version.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/dev/update_version.py b/scripts/dev/update_version.py
index c67873496..1029fb29d 100644
--- a/scripts/dev/update_version.py
+++ b/scripts/dev/update_version.py
@@ -32,7 +32,7 @@ def verify_branch(version_leap):
branch = proc.stdout.strip()
if (
- version_leap == 'patch' and not re.fullmatch(r'v\d+\.\d+\.\*', branch) or
+ version_leap == 'patch' and not re.fullmatch(r'v\d+\.\d+\.x', branch) or
version_leap != 'patch' and branch != 'main'
):
raise Error(f"Invalid branch for {version_leap} release: {branch}")
@@ -50,7 +50,11 @@ def bump_version(version_leap="patch"):
def show_commit():
- subprocess.run(['git', 'show'], check=True)
+ """Show the latest git commit."""
+ git_args = ['git', 'show']
+ if utils.ON_CI:
+ git_args.append("--color")
+ subprocess.run(git_args, check=True)
if __name__ == "__main__":
@@ -71,14 +75,14 @@ if __name__ == "__main__":
import qutebrowser
version = qutebrowser.__version__
- x_version = '.'.join([str(p) for p in qutebrowser.__version_info__[:-1]] +
+ version_x = '.'.join([str(p) for p in qutebrowser.__version_info__[:-1]] +
['x'])
if utils.ON_CI:
output_file = os.environ["GITHUB_OUTPUT"]
with open(output_file, "w", encoding="ascii") as f:
f.write(f"version={version}\n")
- f.write(f"x_version={x_version}\n")
+ f.write(f"version_x={version_x}\n")
print(f"Outputs for {version} written to GitHub Actions output file")
else:
@@ -89,7 +93,7 @@ if __name__ == "__main__":
"git push origin".format(v=version))
else:
print("* git branch v{x} v{v} && git push --set-upstream origin v{x}"
- .format(v=version, x=x_version))
+ .format(v=version, x=version_x))
print("* Create new release via GitHub (required to upload release "
"artifacts)")
print("* Linux: git fetch && git checkout v{v} && "