commit 67f1011c7cc3c449c1b109eb9ae926dade0b4d46 Author: meliurwen Date: Wed May 19 14:04:46 2021 +0200 Let's try diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..3ff34d6 --- /dev/null +++ b/build.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +set -e + +apt-get update + +apt-get -q -y -o Dpkg::Use-Pty=0 install curl jq + +REPO_NAME=deltachat/deltachat-desktop +TAG_NAME=$(curl --silent --fail --show-error "https://api.github.com/repos/$REPO_NAME/releases/latest" | jq -r .tag_name) + +GET_SRC_MODE="tar" +SRC_DIR_PATH="./" + +if [ $GET_SRC_MODE = "github-tar" ]; then + mkdir tmp_extract + curl --silent --fail -L "https://api.github.com/repos/${REPO_NAME}/tarball/${TAG_NAME}" -o - | tar xvz -f - -C "$SRC_DIR_PATH" || rm -rf tmp_extract && exit 1 + mv tmp_extract/* ../src +else + if [ $GET_SRC_MODE = "github" ] + git clone "https://github.com/${REPO_NAME}.git" src + cd src + git checkout "${TAG_NAME}" + cd .. + else + echo "Not valid mode" + exit 1 + fi +fi + +apt-get -q -y -o Dpkg::Use-Pty=0 --no-install-recommends install npm cargo + +npm install --no-audit +NODE_ENV=production npm run build +NO_ASAR=true npm run pack:generate_config +npm run pack:linux