规范化版本标签
This commit is contained in:
@@ -38,6 +38,15 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: 规范化发布标签
|
||||
id: vars
|
||||
run: |
|
||||
TAG="${{ inputs.tag }}"
|
||||
case "$TAG" in
|
||||
v*) echo "tag=$TAG" >> "$GITHUB_OUTPUT" ;;
|
||||
*) echo "tag=v$TAG" >> "$GITHUB_OUTPUT" ;;
|
||||
esac
|
||||
|
||||
- name: 构建并推送 Docker 镜像
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
@@ -46,5 +55,5 @@ jobs:
|
||||
platforms: linux/amd64,linux/386,linux/arm64/v8,linux/arm/v7,linux/arm/v6
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.IMAGE_NAME }}:${{ inputs.tag }}
|
||||
${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.tag }}
|
||||
${{ env.IMAGE_NAME }}:latest
|
||||
|
||||
@@ -173,6 +173,15 @@ jobs:
|
||||
needs: build-linux
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 规范化发布标签
|
||||
id: vars
|
||||
run: |
|
||||
TAG="${{ inputs.tag }}"
|
||||
case "$TAG" in
|
||||
v*) echo "tag=$TAG" >> "$GITHUB_OUTPUT" ;;
|
||||
*) echo "tag=v$TAG" >> "$GITHUB_OUTPUT" ;;
|
||||
esac
|
||||
|
||||
- name: 下载 Linux 构建产物
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
@@ -183,8 +192,8 @@ jobs:
|
||||
- name: 发布到当前仓库 Release
|
||||
uses: softprops/action-gh-release@v3
|
||||
with:
|
||||
tag_name: ${{ inputs.tag }}
|
||||
name: S-UI ${{ inputs.tag }}
|
||||
tag_name: ${{ steps.vars.outputs.tag }}
|
||||
name: S-UI ${{ steps.vars.outputs.tag }}
|
||||
target_commitish: ${{ github.sha }}
|
||||
prerelease: true
|
||||
fail_on_unmatched_files: true
|
||||
|
||||
@@ -125,6 +125,15 @@ jobs:
|
||||
needs: build-windows
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 规范化发布标签
|
||||
id: vars
|
||||
run: |
|
||||
TAG="${{ inputs.tag }}"
|
||||
case "$TAG" in
|
||||
v*) echo "tag=$TAG" >> "$GITHUB_OUTPUT" ;;
|
||||
*) echo "tag=v$TAG" >> "$GITHUB_OUTPUT" ;;
|
||||
esac
|
||||
|
||||
- name: 下载 Windows 构建产物
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
@@ -135,8 +144,8 @@ jobs:
|
||||
- name: 发布到当前仓库 Release
|
||||
uses: softprops/action-gh-release@v3
|
||||
with:
|
||||
tag_name: ${{ inputs.tag }}
|
||||
name: S-UI ${{ inputs.tag }}
|
||||
tag_name: ${{ steps.vars.outputs.tag }}
|
||||
name: S-UI ${{ steps.vars.outputs.tag }}
|
||||
target_commitish: ${{ github.sha }}
|
||||
prerelease: true
|
||||
fail_on_unmatched_files: true
|
||||
|
||||
@@ -50,10 +50,10 @@ bash <(curl -Ls https://raw.githubusercontent.com/admin8800/s-ui/main/install.sh
|
||||
|
||||
## 安装旧版本
|
||||
|
||||
**步骤 1:** 如果要安装指定旧版本,请在安装命令末尾追加版本号。例如版本 `1.0.0`:
|
||||
**步骤 1:** 如果要安装指定旧版本,请在安装命令末尾追加带 `v` 的版本标签。例如版本 `v1.0.0`:
|
||||
|
||||
```sh
|
||||
VERSION=1.0.0 && bash <(curl -Ls https://raw.githubusercontent.com/admin8800/s-ui/$VERSION/install.sh) $VERSION
|
||||
VERSION=v1.0.0 && bash <(curl -Ls https://raw.githubusercontent.com/admin8800/s-ui/$VERSION/install.sh) $VERSION
|
||||
```
|
||||
|
||||
## 手动安装
|
||||
|
||||
+4
-3
@@ -148,11 +148,12 @@ install_s-ui() {
|
||||
fi
|
||||
else
|
||||
last_version=$1
|
||||
[[ "${last_version}" != v* ]] && last_version="v${last_version}"
|
||||
url="https://github.com/admin8800/s-ui/releases/download/${last_version}/s-ui-linux-$(arch).tar.gz"
|
||||
echo -e "开始安装 s-ui v$1"
|
||||
echo -e "开始安装 s-ui ${last_version}"
|
||||
wget -N --no-check-certificate -O /tmp/s-ui-linux-$(arch).tar.gz ${url}
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo -e "${red}下载 s-ui v$1 失败,请检查该版本是否存在${plain}"
|
||||
echo -e "${red}下载 s-ui ${last_version} 失败,请检查该版本是否存在${plain}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@@ -175,7 +176,7 @@ install_s-ui() {
|
||||
|
||||
systemctl enable s-ui --now
|
||||
|
||||
echo -e "${green}s-ui v${last_version}${plain} 安装完成,现已启动并运行..."
|
||||
echo -e "${green}s-ui ${last_version}${plain} 安装完成,现已启动并运行..."
|
||||
echo -e "你可以通过以下 URL 访问面板:${green}"
|
||||
/usr/local/s-ui/sui uri
|
||||
echo -e "${plain}"
|
||||
|
||||
@@ -90,7 +90,7 @@ update() {
|
||||
}
|
||||
|
||||
custom_version() {
|
||||
echo "请输入面板版本(例如 0.0.1):"
|
||||
echo "请输入面板版本(例如 v1.4.1):"
|
||||
read panel_version
|
||||
|
||||
if [ -z "$panel_version" ]; then
|
||||
@@ -98,6 +98,8 @@ custom_version() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[[ "${panel_version}" != v* ]] && panel_version="v${panel_version}"
|
||||
|
||||
download_link="https://raw.githubusercontent.com/admin8800/s-ui/main/install.sh"
|
||||
|
||||
install_command="bash <(curl -Ls $download_link) $panel_version"
|
||||
|
||||
Reference in New Issue
Block a user