lbry-desktop/build.sh

89 lines
1.8 KiB
Bash
Raw Normal View History

2017-01-18 22:39:21 +01:00
#!/bin/bash
2017-01-16 20:06:53 +01:00
set -o xtrace
set -eu
2017-01-18 17:37:44 +01:00
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ "$(uname)" == "Darwin" ]; then
2017-01-27 01:21:27 +01:00
ICON="$ROOT/build/icon.icns"
else
2017-01-27 01:21:27 +01:00
ICON="$ROOT/build/icons/lbry48.png"
fi
2017-02-10 20:11:26 +01:00
FULL_BUILD="${FULL_BUILD:-false}"
if [ -n "${TEAMCITY_VERSION:-}" ]; then
2017-02-10 20:11:26 +01:00
FULL_BUILD="true"
elif [ -n "${APPVEYOR:-}" ]; then
FULL_BUILD="true"
fi
if [ "$FULL_BUILD" == "true" ]; then
# install dependencies
$ROOT/prebuild.sh
2017-01-19 10:51:54 +01:00
VENV="$ROOT/build_venv"
if [ -d "$VENV" ]; then
rm -rf "$VENV"
fi
virtualenv "$VENV"
set +u
source "$VENV/bin/activate"
set -u
2017-01-27 02:38:52 +01:00
pip install -U pip setuptools pyinstaller
2017-02-16 01:50:38 +01:00
python set_version.py
python set_build.py
2017-01-18 22:35:06 +01:00
fi
2017-01-18 22:33:27 +01:00
2017-01-27 02:38:52 +01:00
npm install
2017-01-27 02:50:57 +01:00
pushd $ROOT/app
npm install
popd
2017-01-27 02:38:52 +01:00
pushd "$ROOT/lbry"
pip install -r requirements.txt
# need to install our version of lbryum, not
# what is currently on master
pushd "$ROOT/lbryum"
pip install .
popd
pip install .
popd
2017-01-18 17:37:44 +01:00
(
cd "$ROOT/lbrynet"
2017-01-31 00:14:18 +01:00
pyinstaller -y lbry.onefile.spec
2017-01-18 17:37:44 +01:00
)
(
cd "$ROOT/lbry-web-ui"
npm install
node_modules/.bin/node-sass --output dist/css --sourcemap=none scss/
node_modules/.bin/webpack
2017-01-27 01:21:27 +01:00
rm -rf "$ROOT/app/dist"
cp -r dist "$ROOT/app/dist"
2017-01-18 17:37:44 +01:00
)
2017-02-10 20:11:26 +01:00
mv "$ROOT/lbrynet/dist/lbrynet-daemon" "$ROOT/app/dist"
2017-01-16 20:06:53 +01:00
2017-01-26 19:30:02 +01:00
2017-02-10 20:11:26 +01:00
if [ "$FULL_BUILD" == "true" ]; then
2017-01-27 03:36:05 +01:00
if [ "$(uname)" == "Darwin" ]; then
security unlock-keychain -p ${KEYCHAIN_PASSWORD} osx-build.keychain
fi
2017-01-18 19:03:10 +01:00
2017-02-10 01:54:42 +01:00
node_modules/.bin/build -p never
2017-02-10 01:53:07 +01:00
echo 'Build and packaging complete.'
else
2017-02-08 17:20:34 +01:00
echo 'Build complete. Run `./node_modules/.bin/electron app` to launch the app'
fi
2017-01-18 22:33:27 +01:00
2017-02-10 20:11:26 +01:00
if [ "$FULL_BUILD" == "true" ]; then
2017-02-10 01:53:07 +01:00
# electron-build has a publish feature, but I had a hard time getting
# it to reliably work and it also seemed difficult to configure. Not proud of
# this, but it seemed better to write my own.
pip install PyGithub uritemplate
2017-02-10 03:09:31 +01:00
python release-on-tag.py
2017-01-19 10:51:54 +01:00
deactivate
fi