mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-25 18:03:50 +00:00
strip v
from tags when uploading binaries
This commit is contained in:
parent
f1f86f9a74
commit
10bf38e42f
@ -1,8 +1,10 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
# Security: No third-party dependencies here!
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
ref = os.environ["GITHUB_REF"]
|
ref = os.environ["GITHUB_REF"]
|
||||||
@ -17,7 +19,8 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
# Upload binaries (be it release or snapshot)
|
# Upload binaries (be it release or snapshot)
|
||||||
if tag:
|
if tag:
|
||||||
upload_dir = tag
|
# remove "v" prefix from version tags.
|
||||||
|
upload_dir = re.sub(r"^v([\d.]+)$", r"\1", tag)
|
||||||
else:
|
else:
|
||||||
upload_dir = f"branches/{branch}"
|
upload_dir = f"branches/{branch}"
|
||||||
subprocess.check_call([
|
subprocess.check_call([
|
||||||
|
Loading…
Reference in New Issue
Block a user