-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake-release
executable file
·73 lines (55 loc) · 1.9 KB
/
make-release
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
#!/bin/bash
set -ue
export COPYFILE_DISABLE=true
BRANCH=${1:-main}
ZXBDIST=zxbasic
[email protected]:boriel-basic/zxbasic.git
echo Creating release on branch ${BRANCH}
rm -rf ${ZXBDIST} dist/${ZXBDIST}
git clone --depth=1 --branch ${BRANCH} ${REPO_URL} "${ZXBDIST}"
RELEASE=${2:-$(cat $ZXBDIST/src/zxbc/version.py|sed -e 's/^[^0-9]*//'|sed -e 's/[^0-9]*$//')}
echo $RELEASE
echo "VERSION = '$RELEASE'">$ZXBDIST/src/zxbc/version.py
rsync -au $ZXBDIST dist
cd dist/$ZXBDIST
# remove some unneeded files
rm -f *.{ini,spec,yml} setup.py
# copy needed modules (ply, six, ...)
MOD_DIR=../../modules
for f in $(cat ${MOD_DIR}/MANIFEST); do
cp -va ${MOD_DIR}/$f .
done
./zxbc.py --version
cd ..
rm -rf $ZXBDIST/{tests,scratch,.[a-z]*,*.spec,*.egg-info,doc,docs,*.lock,*.toml}
find $ZXBDIST -type d -name ".*" -exec rm -rf {} \; 2>/dev/null || true
find $ZXBDIST -type d -name ".*" -delete
find $ZXBDIST -type f -name "*.pyc" -delete
find $ZXBDIST -type d -name "__pycache__" -delete
tar -zcf zxbasic.tar.gz $ZXBDIST
zip -9qr zxbasic.zip $ZXBDIST
# Package generic archives
mv zxbasic.zip zxbasic-$RELEASE.zip
mv zxbasic.tar.gz zxbasic-$RELEASE.tar.gz
# Package win32 version
cp -af ../win32/* $ZXBDIST
rm -f zxbasic-$RELEASE-win32.zip # Files in zip are not overwritten?
zip -9qr zxbasic-$RELEASE-win32.zip $ZXBDIST
rm -rf $ZXBDIST
# Package linux64 version
tar -zxf zxbasic-$RELEASE.tar.gz
cp -af ../linux64/* $ZXBDIST
tar -zcf zxbasic-$RELEASE-linux64.tar.gz $ZXBDIST
rm -rf $ZXBDIST
# Package macos version
tar -zxf zxbasic-$RELEASE.tar.gz
cp -af ../macos/* $ZXBDIST
tar -zcf zxbasic-$RELEASE-macos.tar.gz $ZXBDIST
rm -rf $ZXBDIST
echo Uploading...
scp zxbasic-$RELEASE.* zxbasic-$RELEASE-{win32,linux64,macos}.* [email protected]:/var/www/boriel.com/web/files/zxb
echo Done!
echo Download from:
for i in zxbasic-$RELEASE.* zxbasic-$RELEASE-{win32,linux64,macos}.*; do
echo http://www.boriel.com/files/zxb/$i
done