also this
This commit is contained in:
parent
3874459e4f
commit
387a6125e5
1 changed files with 10 additions and 2 deletions
12
release.py
12
release.py
|
@ -111,6 +111,11 @@ def write_metadata(channel: str, metadata: dict):
|
||||||
with open(filepath, 'w') as file:
|
with open(filepath, 'w') as file:
|
||||||
file.write(metadata)
|
file.write(metadata)
|
||||||
|
|
||||||
|
def commit_and_push(channel: str, version: str):
|
||||||
|
os.system('git add .')
|
||||||
|
os.system(f'git commit -m "[releaser] Release {version} on {channel}"')
|
||||||
|
os.system('git push')
|
||||||
|
|
||||||
# other
|
# other
|
||||||
|
|
||||||
def confirm(prompt: str) -> bool:
|
def confirm(prompt: str) -> bool:
|
||||||
|
@ -120,7 +125,7 @@ def confirm(prompt: str) -> bool:
|
||||||
def hash_file(filepath: str) -> str:
|
def hash_file(filepath: str) -> str:
|
||||||
with open(filepath, 'rb') as file:
|
with open(filepath, 'rb') as file:
|
||||||
return sha256(file.read()).hexdigest()
|
return sha256(file.read()).hexdigest()
|
||||||
|
|
||||||
# main
|
# main
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -168,7 +173,10 @@ def main():
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
print("Done, don't forget to commit and push")
|
if confirm("Commit and push?"):
|
||||||
|
commit_and_push(channel, version)
|
||||||
|
|
||||||
|
print("Done")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in a new issue