-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake-release
More file actions
executable file
·77 lines (60 loc) · 2.05 KB
/
make-release
File metadata and controls
executable file
·77 lines (60 loc) · 2.05 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
#!/bin/bash
set -ue
export COPYFILE_DISABLE=true
BRANCH=${1:-main}
ZXBDIST=zxbasic
REPO_URL=${REPO_URL:-git@github.com:boriel-basic/zxbasic.git}
ZXVERSION_FILE=$ZXBDIST/src/zxbc/version.py
UPLOAD_DIR=/mnt/data01/old-boriel.com/blog/files/zxb
UPLOAD=${UPLOAD:-yes}
echo Creating release on branch ${BRANCH}
rm -rf ${ZXBDIST} dist/${ZXBDIST}
git clone --depth=1 --branch ${BRANCH} ${REPO_URL} "${ZXBDIST}"
RELEASE=${2:-$(cat $ZXVERSION_FILE|grep VERSION|sed -e 's/^[^0-9]*//'|sed -e 's/[^0-9]*$//')}
echo $RELEASE
echo "VERSION = '$RELEASE'">$ZXVERSION_FILE
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
if [[ "$UPLOAD" == "yes" ]]; then
echo Uploading...
scp zxbasic-$RELEASE.* zxbasic-$RELEASE-{win32,linux64,macos}.* boriel@boriel.com:$UPLOAD_DIR
echo Done!
echo Download from:
for i in zxbasic-$RELEASE.* zxbasic-$RELEASE-{win32,linux64,macos}.*; do
echo https://www.boriel.com/files/zxb/$i
done
fi