forked from plynth/springfield
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabfile.py
27 lines (21 loc) · 876 Bytes
/
fabfile.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
from fabric.api import local, task, abort, settings
from clom import clom
from fabric.contrib.console import confirm
@task
def release():
"""
Release current version to pypi
"""
with settings(warn_only=True):
r = local(clom.git['diff-files']('--quiet', '--ignore-submodules', '--'))
if r.return_code != 0:
abort('There are uncommitted changes, commit or stash them before releasing')
version = open('VERSION.txt').read().strip()
existing_tag = local(clom.git.tag('-l', version), capture=True)
if not existing_tag.strip():
print('Releasing %s...' % version)
local(clom.git.tag(version))
if confirm('Push %s to pypi?' % version, default=True):
local(clom.git.push('origin', 'HEAD'))
local(clom.git.push('origin', version))
local(clom.python('setup.py', 'sdist', 'upload'))