forked from alexfernandez/elyxer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-version
executable file
·75 lines (63 loc) · 2.45 KB
/
create-version
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
#!/bin/bash
# eLyXer -- convert LyX source files to HTML output.
#
# Copyright (C) 2009 Alex Fernández
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Alex 20090316: create a release
VERSION=$(./elyxer.py --hardversion)
DATE=$(./elyxer.py --versiondate)
echo "Creating version $VERSION from $DATE"
# Insert version date in changelog
src/textchange.py "unreleased" $DATE docs/changelog.lyx
./elyxer.py --title="eLyXer changelog" --css "lyx.css" docs/changelog.lyx docs/changelog.html
# Tag and push code
git tag -a -m "Version $VERSION from $DATE to be released" $VERSION
git push
# Add version to setup.py for PyPI
cp src/setup.py setup.py
src/textchange.py "unknown" $VERSION setup.py
# make compressed files
rm -rf dist/elyxer-$VERSION
mkdir -p dist/elyxer-$VERSION
rsync -a --exclude "build" --exclude "dist" \
--exclude ".git" --exclude "samples" \
--exclude "docs/cvs" --exclude "patch" \
--exclude "docs/jsMath" --exclude "docs/MathJax" \
--exclude "extras" --exclude "open-env" \
--exclude "test/*test.html" --exclude "test/subdir/*test.html" \
--exclude "test/parts/*part-test*.html" \
--exclude "docs/#*#" \
. dist/elyxer-$VERSION/
cd dist/elyxer-$VERSION
find . -name "*.pyc" | xargs rm -f
find . -name "*.swp" | xargs rm -f
find . -name "*.lyx~" | xargs rm -f
find . -name "#*#" | xargs rm -f
cd ..
tar -czf elyxer-$VERSION.tar.gz elyxer-$VERSION
rm -f elyxer-$VERSION.zip
zip -qr elyxer-$VERSION.zip elyxer-$VERSION/*
# Sign packages
# gpg -b elyxer-$VERSION.tar.gz
# gpg -b elyxer-$VERSION.zip
# Upload to savannah
# scp elyxer-$VERSION.tar.gz elyxer-$VERSION.tar.gz.sig [email protected]:/releases/elyxer/
# scp elyxer-$VERSION.zip elyxer-$VERSION.zip.sig [email protected]:/releases/elyxer/
# Upload docs
cd ../docs
./upload.sh
cd ..
# Register with the PyPI
python setup.py register