diff --git a/ubuntu22-build.sh b/ubuntu22-build.sh new file mode 100644 index 0000000..42ccdf3 --- /dev/null +++ b/ubuntu22-build.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -e +REPO="http://121.37.111.42:3000/ThbTech/eletron-test.git" +if [ -n "$GIT_USER" ] && [ -n "$GIT_PASS" ]; then REPO="http://$GIT_USER:$GIT_PASS@121.37.111.42:3000/ThbTech/eletron-test.git"; fi +TARGET_DIR="${TARGET_DIR:-$HOME/eletron-test}" +BRANCH="${BRANCH:-main}" +export ELECTRON_MIRROR="${ELECTRON_MIRROR:-https://npmmirror.com/mirrors/electron/}" +sudo apt update +sudo apt install -y git curl build-essential libarchive-tools rpm xz-utils libfuse2 +curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - +sudo apt install -y nodejs +sudo npm i -g cnpm --registry=https://registry.npmmirror.com +rm -rf "$TARGET_DIR" +git clone "$REPO" "$TARGET_DIR" +cd "$TARGET_DIR" +git checkout "$BRANCH" || true +cnpm install +cnpm run build:linux \ No newline at end of file