mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-05 02:20:28 -05:00
30 lines
752 B
Python
30 lines
752 B
Python
#!/usr/bin/env python
|
|
# License: GPLv3 Copyright: 2024, Kovid Goyal <kovid at kovidgoyal.net>
|
|
|
|
import os
|
|
import subprocess
|
|
|
|
|
|
def run(*args: str):
|
|
cp = subprocess.run(args)
|
|
if cp.returncode != 0:
|
|
raise SystemExit(cp.returncode)
|
|
|
|
|
|
def main():
|
|
version = input('Enter the version to publish: ')
|
|
try:
|
|
ans = input(f'Publish version \033[91m{version}\033[m (y/n): ')
|
|
except KeyboardInterrupt:
|
|
ans = 'n'
|
|
if ans.lower() != 'y':
|
|
return
|
|
os.environ['GITHUB_TOKEN'] = open(os.path.join(os.environ['PENV'], 'github-token')).read().strip()
|
|
run('git', 'tag', '-a', 'v' + version, '-m', f'version {version}')
|
|
run('git', 'push')
|
|
run('goreleaser', 'release')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|