2019-03-24 05:39:25 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -x
|
2019-06-23 16:47:35 +03:00
|
|
|
set -e
|
2019-03-24 05:39:25 +03:00
|
|
|
|
2019-03-24 23:55:08 +03:00
|
|
|
if [[ "$TRAVIS" != "" ]] ; then
|
|
|
|
DEPLOY_ENV_TYPE="travis"
|
|
|
|
TAG_NAME=$TRAVIS_TAG
|
|
|
|
elif [[ "$APPVEYOR" != "" ]] ; then
|
|
|
|
DEPLOY_ENV_TYPE="appveyor"
|
|
|
|
TAG_NAME=$APPVEYOR_REPO_TAG_NAME
|
2019-06-23 16:47:35 +03:00
|
|
|
elif [[ "$TF_BUILD" != "" ]] ; then
|
|
|
|
DEPLOY_ENV_TYPE="azure"
|
2019-03-24 23:55:08 +03:00
|
|
|
else
|
|
|
|
DEPLOY_ENV_TYPE="adhoc"
|
|
|
|
fi
|
2019-03-24 09:59:08 +03:00
|
|
|
|
2019-03-24 23:55:08 +03:00
|
|
|
TAG_NAME=${TAG_NAME:-$(git describe --tags)}
|
|
|
|
TAG_NAME=${TAG_NAME:-$(date +'%Y%m%d-%H%M%S')-$(git log --format=%h -1)}
|
2019-03-24 05:39:25 +03:00
|
|
|
|
2019-06-23 17:53:11 +03:00
|
|
|
# Emit the tagname variable for azure to pick up
|
2019-06-23 19:20:40 +03:00
|
|
|
# https://docs.microsoft.com/en-us/azure/devops/pipelines/troubleshooting?view=azure-devops#variables-having--single-quote-appended
|
|
|
|
set +x
|
2019-06-23 17:53:11 +03:00
|
|
|
echo "##vso[task.setvariable variable=wezterm.tagname]$TAG_NAME"
|
2019-06-23 19:20:40 +03:00
|
|
|
set -x
|
2019-06-23 17:53:11 +03:00
|
|
|
|
2019-03-24 05:39:25 +03:00
|
|
|
HERE=$(pwd)
|
|
|
|
|
|
|
|
case $OSTYPE in
|
|
|
|
darwin*)
|
2019-03-24 23:55:08 +03:00
|
|
|
zipdir=WezTerm-macos-$DEPLOY_ENV_TYPE-$TAG_NAME
|
2019-06-27 16:58:21 +03:00
|
|
|
if [[ "$BUILD_REASON" == "Schedule" ]] ; then
|
|
|
|
zipname=WezTerm-macos-nightly.zip
|
|
|
|
else
|
|
|
|
zipname=$zipdir.zip
|
|
|
|
fi
|
|
|
|
rm -rf $zipdir $zipname
|
2019-03-24 23:55:08 +03:00
|
|
|
mkdir $zipdir
|
|
|
|
cp -r assets/macos/WezTerm.app $zipdir/
|
|
|
|
cp target/release/wezterm $zipdir/WezTerm.app
|
2019-06-27 16:58:21 +03:00
|
|
|
zip -r $zipname $zipdir
|
2019-03-24 05:39:25 +03:00
|
|
|
;;
|
2019-03-24 20:42:20 +03:00
|
|
|
msys)
|
2019-03-24 23:55:08 +03:00
|
|
|
zipdir=WezTerm-windows-$DEPLOY_ENV_TYPE-$TAG_NAME
|
2019-06-27 16:58:21 +03:00
|
|
|
if [[ "$BUILD_REASON" == "Schedule" ]] ; then
|
|
|
|
zipname=WezTerm-windows-nightly.zip
|
|
|
|
else
|
|
|
|
zipname=$zipdir.zip
|
|
|
|
fi
|
|
|
|
rm -rf $zipdir $zipname
|
2019-03-24 23:55:08 +03:00
|
|
|
mkdir $zipdir
|
2019-03-24 20:42:20 +03:00
|
|
|
cp target/release/wezterm.exe target/release/wezterm.pdb $zipdir
|
2019-06-27 16:58:21 +03:00
|
|
|
7z a -tzip $zipname $zipdir
|
2019-03-25 03:49:28 +03:00
|
|
|
;;
|
|
|
|
linux-gnu)
|
|
|
|
case `lsb_release -ds` in
|
|
|
|
Ubuntu*|Debian*)
|
|
|
|
rm -rf pkg
|
|
|
|
mkdir -p pkg/debian/usr/bin pkg/debian/DEBIAN
|
|
|
|
cat > pkg/debian/DEBIAN/control <<EOF
|
|
|
|
Package: wezterm
|
2019-06-27 02:04:31 +03:00
|
|
|
Version: ${TAG_NAME#nightly-}
|
2019-03-25 03:49:28 +03:00
|
|
|
Architecture: amd64
|
|
|
|
Maintainer: Wez Furlong <wez@wezfurlong.org>
|
|
|
|
Section: utils
|
|
|
|
Priority: optional
|
|
|
|
Homepage: https://github.com/wez/wezterm
|
|
|
|
Description: Wez's Terminal Emulator.
|
|
|
|
wezterm is a terminal emulator with support for modern features
|
|
|
|
such as fonts with ligatures, hyperlinks, tabs and multiple
|
|
|
|
windows.
|
|
|
|
Depends: libc6, libegl-mesa0, libxcb-icccm4, libxcb-ewmh2, libxcb-keysyms1, libxcb-xkb1, libxkbcommon0, libxkbcommon-x11-0, libfontconfig1, xdg-utils, libxcb-render0, libxcb-shape0, libx11-6, libegl1
|
|
|
|
EOF
|
2019-10-14 10:40:20 +03:00
|
|
|
install -Dsm755 target/release/wezterm pkg/debian/usr/bin
|
2019-06-27 16:58:21 +03:00
|
|
|
if [[ "$BUILD_REASON" == "Schedule" ]] ; then
|
|
|
|
debname=wezterm-nightly
|
|
|
|
else
|
|
|
|
debname=wezterm-$TAG_NAME
|
|
|
|
fi
|
|
|
|
fakeroot dpkg-deb --build pkg/debian $debname.deb
|
2019-10-14 10:40:20 +03:00
|
|
|
tar cJf $debname.tar.xz -C pkg/debian/usr/bin wezterm
|
2019-03-25 03:49:28 +03:00
|
|
|
rm -rf pkg
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2019-03-24 20:42:20 +03:00
|
|
|
;;
|
2019-03-24 05:39:25 +03:00
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|