From 10bf38e42f234e5909bb2abd2c43fecebe769be6 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 19 Jul 2021 11:38:20 +0200 Subject: [PATCH] strip `v` from tags when uploading binaries --- release/deploy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/release/deploy.py b/release/deploy.py index 6e60e3f5d..9363109dd 100755 --- a/release/deploy.py +++ b/release/deploy.py @@ -1,8 +1,10 @@ #!/usr/bin/env python3 import os +import re import subprocess from pathlib import Path from typing import Optional +# Security: No third-party dependencies here! if __name__ == "__main__": ref = os.environ["GITHUB_REF"] @@ -17,7 +19,8 @@ if __name__ == "__main__": # Upload binaries (be it release or snapshot) if tag: - upload_dir = tag + # remove "v" prefix from version tags. + upload_dir = re.sub(r"^v([\d.]+)$", r"\1", tag) else: upload_dir = f"branches/{branch}" subprocess.check_call([