Commit abaf749a authored by Philipp Hörist's avatar Philipp Hörist
Browse files

ci: Add deploy script

parent e80c9325
#!/usr/bin/env python3
import os
import sys
import subprocess
from pathlib import Path
REPO_DIR = Path(__file__).parent.parent
USERNAME = '__token__'
PASSWORD = os.environ['PYPI_TOKEN']
def build() -> None:
cmd = [
'python',
'setup.py',
'sdist',
'bdist_wheel'
]
try:
subprocess.run(cmd, cwd=REPO_DIR, check=True)
except subprocess.CalledProcessError:
sys.exit('buid failed')
def upload() -> None:
cmd = [
'twine',
'upload',
'--username', USERNAME,
'--password', PASSWORD,
'dist/*'
]
try:
subprocess.run(cmd, cwd=REPO_DIR, check=True)
except subprocess.CalledProcessError:
sys.exit('upload failed')
if __name__ == '__main__':
build()
upload()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment