This repository has been archived by the owner on Feb 11, 2018. It is now read-only.
/
.travis_publish_win.sh
executable file
·58 lines (50 loc) · 2.15 KB
/
.travis_publish_win.sh
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
#!/bin/bash
if [ "$TRAVIS_BRANCH" != "master" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "Nothing todo"
exit
fi
mkdir publish
make install || exit $?
cp -rT /usr/$PUB_COPY publish
cd publish
echo "Fix libharfbuzz-1.dll bug"
cp bin/libharfbuzz-0.dll bin/libharfbuzz-1.dll
cp bin/libharfbuzz-gobject-0.dll bin/libharfbuzz-gobject-1.dll
cp bin/libharfbuzz-icu-0.dll bin/libharfbuzz-icu-1.dll
echo "Generate loaders.cache for SVG"
FILE=lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
echo "\"../lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.dll\"" > $FILE
echo "\"svg\" 2 \"gdk-pixbuf\" \"Scalable Vector Graphics\" \"LGPL\"" >> $FILE
echo "\"image/svg+xml\" \"image/svg\" \"image/svg-xml\" \"image/vnd.adobe.svg+xml\" \"text/xml-svg\" \"image/svg+xml-compressed\" \"\"" >> $FILE
echo "\"svg\" \"svgz\" \"svg.gz\" \"\"" >> $FILE
echo "\" <svg\" \"* \" 100" >> $FILE
echo "\" <\!DOCTYPE svg\" \"* \" 100" >> $FILE
echo "" >> $FILE
echo "" >> $FILE
echo "Remove unused files"
find . -name "*.a" -type f -delete &> /dev/null
find . -name "*.h" -type f -delete &> /dev/null
find . -name "*.c" -type f -delete &> /dev/null
find . -name "*.hpp" -type f -delete &> /dev/null
find . -name "*.cpp" -type f -delete &> /dev/null
find . -name "*.o" -type f -delete &> /dev/null
find . -name "*.pc" -type f -delete &> /dev/null
find . -name "*.m4" -type f -delete &> /dev/null
find . -name "*.sh" -type f -delete &> /dev/null
find . -name "*.spec" -type f -delete &> /dev/null
find . -name "*.cmake" -type f -delete &> /dev/null
find . -name include -exec rm -rf {} \; &> /dev/null
find . -name proc -exec rm -rf {} \; &> /dev/null
rm -rf share/doc &> /dev/null
find . -type d -empty -exec rm -rf {} \; &> /dev/null
echo "Get version"
git fetch --unshallow
PKG_VERSION=`git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"`
echo "Generate Zip"
sudo pacman -S zip --noconfirm
zip -r9 ../$PUB_FILE.$PKG_VERSION.zip ./* > /dev/null &> /dev/null
cd ..
if [ ! -z "$PUBLISH_KEY" ]; then
echo "Upload"
curl -u $PUBLISH_KEY -T $PUB_FILE.$PKG_VERSION.zip $PUBLISH_HOST -k
fi