summaryrefslogtreecommitdiff
path: root/bin/build-distribution-archives
diff options
context:
space:
mode:
Diffstat (limited to 'bin/build-distribution-archives')
-rwxr-xr-xbin/build-distribution-archives21
1 files changed, 13 insertions, 8 deletions
diff --git a/bin/build-distribution-archives b/bin/build-distribution-archives
index bbc61996..d1a30014 100755
--- a/bin/build-distribution-archives
+++ b/bin/build-distribution-archives
@@ -1,14 +1,16 @@
+#!/bin/bash
+
# TRAVIS_BRANCH is the branch name or the name of the tag.
-VERSION="$(echo ${TRAVIS_BRANCH} | tr / -)"
-OS="${TRAVIS_OS_NAME}"
+VERSION="$(echo ${TRAVIS_BRANCH:-${GITHUB_REF}} | tr / -)"
+OS="${TRAVIS_OS_NAME:-$(uname)}"
ARCH="$(uname -m)"
MACVERSION="${TRAVIS_OSX_IMAGE}"
-if [ ${MACVERSION} = "xcode9.2" ]; then
+if [ "${MACVERSION}" = "xcode9.2" ]; then
MACVERSION="sierra"
-elif [ ${MACVERSION} = "xcode9.4" ]; then
+elif [ "${MACVERSION}" = "xcode9.4" ]; then
MACVERSION="high_sierra"
-elif [ ${MACVERSION} = "xcode10.2" ]; then
+elif [ "${MACVERSION}" = "xcode10.2" ]; then
MACVERSION="mojave"
fi
@@ -21,6 +23,8 @@ else
cp -a electron/dist/*-unpacked dist/inkstitch/electron
fi
+mkdir artifacts
+
for d in inx/*; do
lang=${d%.*}
lang=${lang#*/}
@@ -28,11 +32,12 @@ for d in inx/*; do
cd dist
if [ "$BUILD" = "windows" ]; then
- zip -r ../inkstitch-${VERSION}-win32-${lang}.zip *
+ echo
+ python -m zipfile -c ../artifacts/inkstitch-${VERSION}-win32-${lang}.zip *
elif [ "$BUILD" = "osx" ]; then
- tar zcf ../inkstitch-${VERSION}-${OS}-${MACVERSION}-${ARCH}-$lang.tar.gz *
+ tar zcf ../artifacts/inkstitch-${VERSION}-${OS}-${MACVERSION}-${ARCH}-$lang.tar.gz *
else
- tar zcf ../inkstitch-${VERSION}-${OS}-${ARCH}-$lang.tar.gz *
+ tar zcf ../artifacts/inkstitch-${VERSION}-${OS}-${ARCH}-$lang.tar.gz *
fi
cd ..
done