-
Notifications
You must be signed in to change notification settings - Fork 10
/
release.ay
executable file
·47 lines (37 loc) · 1.51 KB
/
release.ay
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /usr/bin/env ayrton
import logging
import ayrton
option ('-e')
if make ('install'): # this includes tests
# with remote ('mustang'):
# cd (bash ('~/src/projects/ayrton'))
# git ('pull', 'devel')
# # if this fails, hopefully the whole script stops :)
# make ('tests')
# this command might fail if it wants to
uncommited= git ('status', --short=True) | grep ('^ M', _out=Capture, _fails=True)
if uncommited:
print ("The following files are not commited, I can't release like this")
print (str (uncommited))
exit (1)
# git ('checkout', -b="release-%s" % ayrton.__version__)
if 0 < logging.root.level < 30:
print ("logging is at %d, I can't release like this!" % logging.root.level)
exit (1)
dch (--changelog='ChangeLog.rst', --newversion=ayrton.__version__)
dch (--changelog='ChangeLog.rst', --release=True)
commited= git ('commit', 'ChangeLog.rst',
--message="[*] new entry for %s." % ayrton.__version__,
_out=Capture)
if not commited and 'nothing added to commit' not in commited:
exit (1)
# docs
make ('docs')
rsync (--archive=True, --verbose=True, --compress=True, --rsh='ssh',
'doc/build/html/', 'www.grulic.org.ar:www/projects/ayrton/')
# release
python3.6 ('setup.py', 'sdist', 'upload')
nvie ('release', 'release-'+ayrton.__version__)
git ('push')
# TODO: does github have an API for making a release?
# no they don't yet