summaryrefslogtreecommitdiff
path: root/bin/build-distribution-archives
blob: d1a300145803ca558243c5d955d2359b3c5b6096 (plain)
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
#!/bin/bash

# TRAVIS_BRANCH is the branch name or the name of the tag.
VERSION="$(echo ${TRAVIS_BRANCH:-${GITHUB_REF}} | tr / -)"
OS="${TRAVIS_OS_NAME:-$(uname)}"
ARCH="$(uname -m)"

MACVERSION="${TRAVIS_OSX_IMAGE}"
if [ "${MACVERSION}" = "xcode9.2" ]; then
    MACVERSION="sierra"
elif [ "${MACVERSION}" = "xcode9.4" ]; then
    MACVERSION="high_sierra"
elif [ "${MACVERSION}" = "xcode10.2" ]; then
    MACVERSION="mojave"
fi

cp -a images/examples palettes symbols fonts dist/inkstitch
cp -a icons locales print dist/inkstitch/bin

if [ "$BUILD" = "osx" ]; then
    cp -a electron/dist/mac dist/inkstitch/electron
else
    cp -a electron/dist/*-unpacked dist/inkstitch/electron
fi

mkdir artifacts

for d in inx/*; do
	lang=${d%.*}
	lang=${lang#*/}	
	cp $d/*.inx dist

    cd dist
	if [ "$BUILD" = "windows" ]; then
        echo
		python -m zipfile -c ../artifacts/inkstitch-${VERSION}-win32-${lang}.zip *
	elif [ "$BUILD" = "osx" ]; then
		tar zcf ../artifacts/inkstitch-${VERSION}-${OS}-${MACVERSION}-${ARCH}-$lang.tar.gz *
	else
		tar zcf ../artifacts/inkstitch-${VERSION}-${OS}-${ARCH}-$lang.tar.gz *
	fi
	cd ..
done