From e952ee2c3f8ed8d53fbbf0a7b780d1fac653c2fb Mon Sep 17 00:00:00 2001 From: root Date: Sat, 22 Nov 2025 22:41:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ubuntu22-build.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ubuntu22-build.sh 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