You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
deltachat-desktop/build.sh

56 lines
1.4 KiB

#!/bin/sh
set -e
echo "Updating apt..."
apt-get -qq update
echo "Installing get tools..."
apt-get -qq -y --no-install-recommends install curl jq ca-certificates git > /dev/null
REPO_NAME="deltachat/deltachat-desktop"
REPO_URL="https://github.com/${REPO_NAME}.git"
if [ -z ${1+x} ]; then
echo "No release selected, selecting the latest..."
CHECKOUT="$(curl --silent --fail --show-error "https://api.github.com/repos/${REPO_NAME}/releases/latest" | jq -r .tag_name)"
echo "Latest release: ${CHECKOUT}"
else
CHECKOUT="${1}"
echo "Release selected: ${CHECKOUT}"
fi
echo "Getting the source..."
./getsauce.sh "git" \
"${REPO_URL}" \
"${CHECKOUT}"
cd project
echo "Installing build dependencies (apt)..."
apt-get -qq -y --no-install-recommends install npm cargo > /dev/null
echo "Installing build dependencies (npm)..."
npm install
echo "Build dependencies installed."
echo "Building the app..."
NODE_ENV=production npm run build
NO_ASAR=true npm run pack:generate_config
echo "App built successfully."
echo "Packaging..."
npm run pack:linux
echo "App packaged successfully."
cd ..
echo "Package(s) deploy..."
DIST_DIR="project/dist"
INCOMING_DIR="repo/incoming"
READY_SUFFIX=".ready"
mkdir -p "${INCOMING_DIR}"
./deploy.sh "${DIST_DIR}" "${INCOMING_DIR}" "${READY_SUFFIX}"
echo "##### REPOSITORY STUFF #####"
MAIN_DIR="repo/main"
./repo-main.sh "${MAIN_DIR}" "${INCOMING_DIR}" "${READY_SUFFIX}"