ci(release): auto-bump patch version and release on push to main; docs: document upgrade-agent script in README
Release / Build & Release (push) Canceled after 0s
Release / Build & Release (push) Canceled after 0s
This commit is contained in:
@@ -2,6 +2,8 @@ name: Release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
@@ -15,6 +17,35 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Determine Version Tag
|
||||||
|
id: versioning
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
||||||
|
TAG="${GITHUB_REF#refs/tags/}"
|
||||||
|
else
|
||||||
|
# 获取最新语义化版本 tag (例如 v1.1.0)
|
||||||
|
LATEST_TAG=$(git tag -l "v*" --sort=-v:refname | head -n1)
|
||||||
|
if [ -z "$LATEST_TAG" ]; then
|
||||||
|
LATEST_TAG="v1.0.0"
|
||||||
|
fi
|
||||||
|
# 去除前缀 v
|
||||||
|
VER_NUM="${LATEST_TAG#v}"
|
||||||
|
# 拆解 MAJOR.MINOR.PATCH
|
||||||
|
IFS='.' read -r MAJOR MINOR PATCH <<< "$VER_NUM"
|
||||||
|
PATCH=$((PATCH + 1))
|
||||||
|
TAG="v${MAJOR}.${MINOR}.${PATCH}"
|
||||||
|
echo "Auto incremented patch version to $TAG"
|
||||||
|
|
||||||
|
# 打上本地 tag 并推送到远程
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git tag "$TAG"
|
||||||
|
git push origin "$TAG"
|
||||||
|
fi
|
||||||
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
@@ -40,6 +71,8 @@ jobs:
|
|||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
|
tag_name: ${{ steps.versioning.outputs.tag }}
|
||||||
|
name: Release ${{ steps.versioning.outputs.tag }}
|
||||||
files: |
|
files: |
|
||||||
dist/*
|
dist/*
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
|
|||||||
@@ -73,17 +73,27 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🚀 极速一键部署 (推荐)
|
## 🚀 极速一键部署与平滑升级
|
||||||
|
|
||||||
|
### 1. 一键全自动安装 (推荐)
|
||||||
无论是在受控端 VPS 还是中心端,只需一行命令即可交互式安装与启动:
|
无论是在受控端 VPS 还是中心端,只需一行命令即可交互式安装与启动:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash <(curl -sSL https://raw.githubusercontent.com/kyaring/vps-commander/main/deploy/install.sh)
|
bash <(curl -sSL https://raw.githubusercontent.com/kyaring/vps-commander/main/deploy/install.sh)
|
||||||
```
|
```
|
||||||
|
|
||||||
- **安装 Agent (受控 VPS)**:输入 Hub 的 WSS 地址与通信密钥,全自动配置开机自启并秒级连入集群。
|
- **安装 Agent (受控 VPS)**:输入 Hub 的 WSS 地址与通信密钥,全自动配置开机自启并秒级连入集群。
|
||||||
- **安装 Hub (中心服务端)**:自动生成安全 API Key / Web 面板密码并以 Systemd 托管常驻。
|
- **安装 Hub (中心服务端)**:自动生成安全 API Key / Web 面板密码并以 Systemd 托管常驻。
|
||||||
|
|
||||||
|
### 2. 受控端 Agent 一键平滑升级 (免重输配置)
|
||||||
|
当新版本发布后,无需重新配置通信密钥或重新安装,在任意受控机上直接运行升级脚本:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://raw.githubusercontent.com/kyaring/vps-commander/main/deploy/upgrade-agent.sh | bash
|
||||||
|
```
|
||||||
|
- 自动检测并拉取 GitHub 最新版本架构包(AMD64 / ARM64);
|
||||||
|
- 自动备份旧版本二进制(`.bak`);
|
||||||
|
- 升级异常(校验失败或无法启动)时**自动秒级回滚**,保证节点永不失联。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🛠️ 手动编译部署
|
## 🛠️ 手动编译部署
|
||||||
|
|||||||
Reference in New Issue
Block a user