actual/bin/package-browser

75 lines
1.4 KiB
Text
Raw Normal View History

#!/bin/bash -e
2022-04-29 02:44:38 +00:00
ROOT=`dirname $0`
VERSION=""
RELEASE=""
2022-05-29 19:09:35 +00:00
CI=${CI:-false}
2022-04-29 02:44:38 +00:00
cd "$ROOT/.."
POSITIONAL=()
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--version)
VERSION="$2"
shift
shift
;;
--beta)
RELEASE="beta"
shift
;;
--release)
RELEASE="production"
shift
;;
*)
POSITIONAL+=("$1")
shift
;;
esac
done
set -- "${POSITIONAL[@]}"
if [ -z "$VERSION" ] && [ -n "$RELEASE" ]; then
echo "Version is required if making a release"
exit 1
fi
if [ -n "$RELEASE" ]; then
read -p "Deploy release for browser: $RELEASE v$VERSION? [y/N] " -r
if [ -z "$REPLY" ] || [ "$REPLY" != "y" ]; then
exit 2
fi
PACKAGE_VERSION=`node -p -e "require('./packages/desktop-electron/package.json').version"`
if [ "$VERSION" != "$PACKAGE_VERSION" ] && [ "$VERSION-next" != "$PACKAGE_VERSION" ]; then
echo "Version in desktop-electron/package.json does not match given version! ($PACKAGE_VERSION)"
exit 4
fi
fi
2022-05-29 19:09:35 +00:00
# There's no need to check linting in CI as it'll be done in a different step.
if [ $CI != true ]; then
yarn lint
fi
2022-04-29 02:44:38 +00:00
(
cd packages/loot-design;
../../node_modules/.bin/patch-package
)
(
cd packages/loot-core;
ACTUAL_RELEASE_TYPE=$RELEASE yarn build:browser
)
(
cd packages/desktop-client;
REACT_APP_RELEASE_TYPE=$RELEASE yarn build:browser
)
echo "packages/desktop-client/build"