forked from six8/packstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
29 lines (23 loc) · 804 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
28
29
from fabric.api import local, task, abort, settings
from clom import clom
@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()
print('Releasing %s...' % version)
local(clom.git.tag(version, a=True, m='Release %s' % version))
local(clom.git.push('origin', 'HEAD'))
local(clom.git.push('origin', version))
local(clom.python('setup.py', 'sdist', 'upload'))
@task
def register():
"""
Register current version to pypi
"""
local(clom.python('setup.py', 'register'))