mirror of
https://github.com/TencentCloud/Octop.git
synced 2026-10-21 06:29:24 +08:00
* feat(desktop): Octop 桌面客户端 (#462) * feat: add multi-platform green portable packaging Ship relocatable Octop-<plat>.zip via scripts/green (portable CPython, frozen uv.lock deps, Windows pywin32 DLL fix) and octop-portable.yml. No OOB overlay or product trimming; first run uses upstream setup. Co-authored-by: Harry <forcemeter@users.noreply.github.com> * feat(desktop): Wails v3 shell with green portable under ~/.octop Move green packaging to desktop/portable, add a Wails v3 client that downloads Octop-<plat>.zip, spawns launch.py with OCTOP_HOME=~/.octop, and exposes locale/theme/autostart/tray/macOS caffeinate settings. Green upgrades install into packages via OCTOP_GREEN_PACKAGES. Co-authored-by: Harry <forcemeter@users.noreply.github.com> * fix(desktop): add Wails v3 Taskfile and build/config.yml wails3 build/dev look for Taskfile.yml and build/config.yml in desktop/src. Un-ignore that tree from the repo-wide build/ gitignore. Co-authored-by: Harry <forcemeter@users.noreply.github.com> * 初始化桌面客户端 * add drag and toggle * add prevent sleep * update * change dock icon * clean package/useless files * add Attach zips to GitHub Release * pack file into windows bin-file * Packages a production app * chanage workflow name * chanage workflow name * linux package in single ifle * linux package in single ifle * 在浏览器中打开_blank 的链接 * upgrade python to 3.12 --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Harry <forcemeter@users.noreply.github.com> Co-authored-by: 杨树海 <yangshuhai@pdnews.cn> * ci: cascade desktop package on release and stop all-branch builds (#463) Auto Tag dispatches Octop Desktop with Release/Docker. Restrict octop-desktop.yml to v* tags + workflow_dispatch only. Co-authored-by: jubaoliang <jubaoliang@tencent.com> --------- Co-authored-by: Harry <56063441+forcemeter@users.noreply.github.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Harry <forcemeter@users.noreply.github.com> Co-authored-by: 杨树海 <yangshuhai@pdnews.cn> Co-authored-by: jubaoliang <jubaoliang@tencent.com>
90 lines
2.3 KiB
Bash
Executable File
90 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Download python-build-standalone into desktop/portable/runtimes/<plat>.
|
|
#
|
|
# Usage:
|
|
# bash desktop/portable/bootstrap-runtime.sh # host platform
|
|
# bash desktop/portable/bootstrap-runtime.sh darwin-arm64
|
|
set -euo pipefail
|
|
|
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
# shellcheck source=desktop/portable/_common.sh
|
|
source "${REPO_ROOT}/desktop/portable/_common.sh"
|
|
|
|
download() {
|
|
local url="$1"
|
|
local dest="$2"
|
|
mkdir -p "$(dirname "$dest")"
|
|
if [[ -f "$dest" && -s "$dest" ]]; then
|
|
echo "[bootstrap] cache hit ${dest}" >&2
|
|
return 0
|
|
fi
|
|
echo "[bootstrap] downloading ${url}" >&2
|
|
curl -fL --retry 3 --retry-delay 2 -o "${dest}.partial" "$url"
|
|
mv "${dest}.partial" "$dest"
|
|
}
|
|
|
|
flatten_pbs_install() {
|
|
local extract_dir="$1"
|
|
local dest="$2"
|
|
rm -rf "$dest"
|
|
mkdir -p "$(dirname "$dest")"
|
|
if [[ -d "${extract_dir}/python" ]]; then
|
|
mv "${extract_dir}/python" "$dest"
|
|
elif [[ -d "${extract_dir}/install" ]]; then
|
|
mv "${extract_dir}/install" "$dest"
|
|
else
|
|
echo "[bootstrap] unexpected PBS layout under ${extract_dir}" >&2
|
|
find "$extract_dir" -maxdepth 2 -print >&2 || true
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
bootstrap_one() {
|
|
local plat="$1"
|
|
local triple archive url cache dest
|
|
triple="$(plat_triple "$plat")" || {
|
|
echo "unknown platform: $plat" >&2
|
|
exit 1
|
|
}
|
|
archive="$(pbs_archive_name "$plat")"
|
|
url="${PBS_BASE_URL}/${archive}"
|
|
cache="${GREEN_CACHE}/${archive}"
|
|
dest="${GREEN_RUNTIMES}/${plat}"
|
|
|
|
mkdir -p "$GREEN_RUNTIMES" "$GREEN_CACHE"
|
|
if [[ -x "$(runtime_python "$dest")" || -f "${dest}/python.exe" ]]; then
|
|
echo "[bootstrap] ${plat}: runtime already present → ${dest}" >&2
|
|
return 0
|
|
fi
|
|
|
|
download "$url" "$cache"
|
|
local tmp
|
|
tmp="$(mktemp -d "${GREEN_CACHE}/extract.XXXXXX")"
|
|
tar -xzf "$cache" -C "$tmp"
|
|
flatten_pbs_install "$tmp" "$dest"
|
|
rm -rf "$tmp"
|
|
|
|
local py
|
|
py="$(runtime_python "$dest")"
|
|
if [[ ! -x "$py" && ! -f "$py" ]]; then
|
|
echo "[bootstrap] python missing after extract: ${py}" >&2
|
|
exit 1
|
|
fi
|
|
echo "[bootstrap] ${plat}: ${py}" >&2
|
|
"$py" -c "import sys; print(sys.version)" >&2 || true
|
|
}
|
|
|
|
main() {
|
|
local plat="${1:-}"
|
|
if [[ -z "$plat" ]]; then
|
|
plat="$(host_plat)"
|
|
fi
|
|
if ! is_known_plat "$plat"; then
|
|
echo "unknown platform: $plat (known: ${ALL_PLATS[*]})" >&2
|
|
exit 1
|
|
fi
|
|
bootstrap_one "$plat"
|
|
}
|
|
|
|
main "${1:-}"
|