规范化版本标签

This commit is contained in:
admin8800
2026-05-10 16:29:45 +08:00
parent f63ec0db18
commit 2ca3a17cad
6 changed files with 41 additions and 11 deletions
+10 -1
View File
@@ -38,6 +38,15 @@ jobs:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} 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 镜像 - name: 构建并推送 Docker 镜像
uses: docker/build-push-action@v7 uses: docker/build-push-action@v7
with: with:
@@ -46,5 +55,5 @@ jobs:
platforms: linux/amd64,linux/386,linux/arm64/v8,linux/arm/v7,linux/arm/v6 platforms: linux/amd64,linux/386,linux/arm64/v8,linux/arm/v7,linux/arm/v6
push: true push: true
tags: | tags: |
${{ env.IMAGE_NAME }}:${{ inputs.tag }} ${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.tag }}
${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:latest
+11 -2
View File
@@ -173,6 +173,15 @@ jobs:
needs: build-linux needs: build-linux
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: 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 构建产物 - name: 下载 Linux 构建产物
uses: actions/download-artifact@v8 uses: actions/download-artifact@v8
with: with:
@@ -183,8 +192,8 @@ jobs:
- name: 发布到当前仓库 Release - name: 发布到当前仓库 Release
uses: softprops/action-gh-release@v3 uses: softprops/action-gh-release@v3
with: with:
tag_name: ${{ inputs.tag }} tag_name: ${{ steps.vars.outputs.tag }}
name: S-UI ${{ inputs.tag }} name: S-UI ${{ steps.vars.outputs.tag }}
target_commitish: ${{ github.sha }} target_commitish: ${{ github.sha }}
prerelease: true prerelease: true
fail_on_unmatched_files: true fail_on_unmatched_files: true
+11 -2
View File
@@ -125,6 +125,15 @@ jobs:
needs: build-windows needs: build-windows
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: 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 构建产物 - name: 下载 Windows 构建产物
uses: actions/download-artifact@v8 uses: actions/download-artifact@v8
with: with:
@@ -135,8 +144,8 @@ jobs:
- name: 发布到当前仓库 Release - name: 发布到当前仓库 Release
uses: softprops/action-gh-release@v3 uses: softprops/action-gh-release@v3
with: with:
tag_name: ${{ inputs.tag }} tag_name: ${{ steps.vars.outputs.tag }}
name: S-UI ${{ inputs.tag }} name: S-UI ${{ steps.vars.outputs.tag }}
target_commitish: ${{ github.sha }} target_commitish: ${{ github.sha }}
prerelease: true prerelease: true
fail_on_unmatched_files: true fail_on_unmatched_files: true
+2 -2
View File
@@ -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 ```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
View File
@@ -148,11 +148,12 @@ install_s-ui() {
fi fi
else else
last_version=$1 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" 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} wget -N --no-check-certificate -O /tmp/s-ui-linux-$(arch).tar.gz ${url}
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo -e "${red}下载 s-ui v$1 失败,请检查该版本是否存在${plain}" echo -e "${red}下载 s-ui ${last_version} 失败,请检查该版本是否存在${plain}"
exit 1 exit 1
fi fi
fi fi
@@ -175,7 +176,7 @@ install_s-ui() {
systemctl enable s-ui --now 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}" echo -e "你可以通过以下 URL 访问面板:${green}"
/usr/local/s-ui/sui uri /usr/local/s-ui/sui uri
echo -e "${plain}" echo -e "${plain}"
+3 -1
View File
@@ -90,7 +90,7 @@ update() {
} }
custom_version() { custom_version() {
echo "请输入面板版本(例如 0.0.1):" echo "请输入面板版本(例如 v1.4.1):"
read panel_version read panel_version
if [ -z "$panel_version" ]; then if [ -z "$panel_version" ]; then
@@ -98,6 +98,8 @@ custom_version() {
exit 1 exit 1
fi fi
[[ "${panel_version}" != v* ]] && panel_version="v${panel_version}"
download_link="https://raw.githubusercontent.com/admin8800/s-ui/main/install.sh" download_link="https://raw.githubusercontent.com/admin8800/s-ui/main/install.sh"
install_command="bash <(curl -Ls $download_link) $panel_version" install_command="bash <(curl -Ls $download_link) $panel_version"