#!/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 "Moving package(s) to the repo..." mkdir -p "${MAIN_DIR}" ./movedebs.sh "${MAIN_DIR}" "${INCOMING_DIR}" "${READY_SUFFIX}" echo "Installing repository build dependencies (apt)..." apt-get -qq -y --no-install-recommends install apt-utils > /dev/null echo "Updating the repo..." REPO_PATH="repo" TEMP_DIR="$(mktemp -d)" ./repo-update.sh "${REPO_PATH}" "${TEMP_DIR}" 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" ./repo-sign.sh "${REPO_PATH}" echo "Committing changes..." mv "${TEMP_DIR}"/* "${REPO_PATH}"/ #echo "deb file:/repo /" > /etc/apt/sources.list.d/custom-repo.list