generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-release.py
executable file
·37 lines (25 loc) · 911 Bytes
/
create-release.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
import sys
from datetime import datetime
from subprocess import run, CalledProcessError
PROPERTIES_FILENAME = "gradle.properties"
def main():
tag_name = datetime.utcnow().strftime("%Y.%m.%d.%H%M")
create_tag(tag_name)
push_tags(tag_name)
print(f"sucessfully pushed release tag {tag_name}")
def create_tag(tag_name):
try:
run(["git", "tag", tag_name], check=True)
except CalledProcessError:
error_exit(f"something went wrong while creating the tag '{tag_name}'. see git output above")
def push_tags(tag_name):
try:
run(["git", "push", "origin", tag_name], check=True)
except CalledProcessError:
error_exit(f"something went wrong while pushing the tag '{tag_name}' to remote. see git output above")
def error_exit(message):
print(message, file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()