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

79 lines
2.0 KiB

4 years ago
#!/bin/sh
set -e
4 years ago
echo "Updating apt..."
apt-get -qq update
4 years ago
4 years ago
echo "Installing get tools..."
apt-get -qq -y --no-install-recommends install curl jq ca-certificates git > /dev/null
4 years ago
4 years ago
REPO_NAME="deltachat/deltachat-desktop"
REPO_URL="https://github.com/${REPO_NAME}.git"
4 years ago
4 years ago
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}"
4 years ago
else
4 years ago
CHECKOUT="${1}"
echo "Release selected: ${CHECKOUT}"
4 years ago
fi
4 years ago
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."
4 years ago
4 years ago
echo "Building the app..."
4 years ago
NODE_ENV=production npm run build
NO_ASAR=true npm run pack:generate_config
4 years ago
echo "App built successfully."
echo "Packaging..."
4 years ago
npm run pack:linux
4 years ago
echo "App packaged successfully."
cd ..
echo "Package(s) deploy..."
DIST_DIR="project/dist"
4 years ago
INCOMING_DIR="repo/incoming"
READY_SUFFIX=".ready"
mkdir -p "${INCOMING_DIR}"
./deploy.sh "${DIST_DIR}" "${INCOMING_DIR}" "${READY_SUFFIX}"
4 years ago
echo "Moving package(s) to the repo..."
4 years ago
mkdir -p "${MAIN_DIR}"
./movedebs.sh "${MAIN_DIR}" "${INCOMING_DIR}" "${READY_SUFFIX}"
4 years ago
4 years ago
echo "Installing repository build dependencies (apt)..."
apt-get -qq -y --no-install-recommends install apt-utils > /dev/null
4 years ago
4 years ago
echo "Updating the repo..."
REPO_PATH="repo"
TEMP_DIR="$(mktemp -d)"
./repo-update.sh "${REPO_PATH}" "${TEMP_DIR}"
4 years ago
apt-get -qq -y --no-install-recommends install gpg gpg-agent
echo "Checking if is possible to sign the repo..."
mkdir -p keys
chmod 600 keys
export GNUPGHOME="${PWD}/keys"
4 years ago
./repo-sign.sh "${REPO_PATH}"
4 years ago
4 years ago
echo "Committing changes..."
mv "${TEMP_DIR}"/* "${REPO_PATH}"/
4 years ago
#echo "deb file:/repo /" > /etc/apt/sources.list.d/custom-repo.list