This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
58 lines (40 loc) · 1.3 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import os
import requests
from fabric.context_managers import lcd
from fabric.operations import local
# Github:
OWNER = 'nekmo'
REPOSITORY = 'nekumo-cloud'
REPO = 'pypi'
GITHUB_TOKEN_FILE = '~/.config/github_token.txt'
GITHUB_TOKEN = open(os.path.expanduser(GITHUB_TOKEN_FILE))
GITHUB_URL = 'https://api.github.com/repos/{owner}/{repository}/releases?access_token={token}'
def devenv():
with lcd('nekumo/ifaces/angular_web/static'):
local('jspm install')
def build():
with lcd('nekumo/ifaces/angular_web'):
local('gulp')
def bumpversion(part='patch'):
local('bumpversion {}'.format(part))
def pypi():
local('python setup.py register -r "{}"'.format(REPO))
local('python setup.py sdist upload -r "{}"'.format(REPO))
def push():
local('git push')
local('git push --tags')
# def github_release():
# version = local('git describe --tags', capture=True)
# requests.get(
# GITHUB_URL.format(owner=OWNER, repository=REPOSITORY, token=GITHUB_TOKEN),
# json={
# "tag_name": version, "target_commitish": "master", "name": version,
# "body": "Release of version {}".format(version),
# "draft": False, "prerelease": False
# }
# )
def release(part='patch'):
build()
bumpversion(part)
push()
pypi()