-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeliver.sh
More file actions
executable file
·101 lines (79 loc) · 2.34 KB
/
deliver.sh
File metadata and controls
executable file
·101 lines (79 loc) · 2.34 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
# Identify release tag
function last_tag_minor()
{
git tag -l $1"*" | sort -rV | head -n 1 | cut -c 7
}
function get_new_tag()
{
MAJOR=$( date +%y%m%d )
MINOR=$( last_tag_minor ${MAJOR} )
MINOR=${MINOR:=-1}
let 'MINOR=MINOR+1'
echo ${MAJOR}${MINOR}
}
function is_index_clean()
{
test -z "$( git status -s )"
}
function fail()
{
echo "Aborting delivery: $1"
exit 0
}
###
TAG=$( get_new_tag )
is_index_clean || fail "repository shall be clean before delivery"
read -p "Do you really want to create a new version (${TAG})? [y/N] " -n 1
[ ${#REPLY} -ne 0 ] && echo ""
[[ ! ${REPLY} =~ ^[yY]$ ]] && fail "exiting"
COMMIT_MSG="RELEASE ${TAG}"
echo "Releasing version ${TAG} ... "
pandoc -f rst -t plain -o README README.rst
sed -e 's,<VERSION>,'${TAG}',' > setup.py <<EOF
#-*- coding: utf-8 -*-
"""Setup script for distributing PyCraft
Typical usage scenarios can either be:
$> python3 setup.py clean
$> python3 setup.py sdist --format=bztar
$> python3 setup.py register
"""
from distutils.core import setup
if __name__ == "__main__":
setup(
name = "PyCraft",
version = "<VERSION>",
license = "CeCILL-C",
description = "High quality Minecraft world editor",
author = "Guillaume Lemaître",
author_email = "guillaume.lemaitre@gmail.com",
url = "http://github.com/seventh/PyCraft",
packages = ["pycraft"],
package_dir = {"pycraft": "Src"},
data_files = [
("/usr/share/doc/pycraft", [
"Doc/AUTHORS",
"Doc/CHANGELOG",
"Doc/Licence_CeCILL-C_V1-en.txt",
"Doc/Licence_CeCILL-C_V1-fr.txt",
"README",
]),
],
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Games/Entertainment",
],
keywords = ["Minecraft"],
)
EOF
python3 setup.py sdist --format=bztar upload || fail "invalid configuration"
git add dist/PyCraft-${TAG}.tar.bz2
git commit -q -m "${COMMIT_MSG}"
git tag ${TAG}
rm MANIFEST README
echo "done."