feat(install): support version-pinned install from release assets

Add PINNED_VERSION mechanism so scripts downloaded from a specific
release (e.g. 2.1.0) install that exact version instead of latest.
CI injects the version via sed during release build. Users can still
override with VERSION= env var. Update release notes and README to
show both pinned and latest install options.
This commit is contained in:
sagit
2026-02-10 10:54:17 +00:00
parent 90debf144b
commit 7557e02e54
4 changed files with 41 additions and 3 deletions
+7
View File
@@ -3,6 +3,9 @@
# GitHub repo used for release downloads
REPO="Sagit-chu/flux-panel"
# 固定版本号(Release 构建时自动填充,留空则获取最新版)
PINNED_VERSION=""
# 获取系统架构
get_architecture() {
ARCH=$(uname -m)
@@ -85,6 +88,10 @@ resolve_version() {
echo "$FLUX_VERSION"
return 0
fi
if [[ -n "${PINNED_VERSION:-}" ]]; then
echo "$PINNED_VERSION"
return 0
fi
if resolve_latest_release_tag; then
return 0