Files
Thing/scripts/release.bat
T
2026-08-11 17:19:36 +08:00

62 lines
1.6 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion
set "SCRIPT=%~dp0release.ps1"
echo ================================================
echo Thing Build Pubilsh
echo 发布目标:https://gitea.atie.fun/LFeng/Thing
echo ================================================
echo.
:: ---------- 版本号 ----------
set "VERSION="
set /p "VERSION=请输入版本号(如 26.8.1,直接回车沿用当前版本): "
set "VER_ARG="
if not "%VERSION%"=="" set "VER_ARG=-Version %VERSION%"
:: ---------- 发布模式 ----------
echo.
echo [1] Build + Pubilsh Gitea
echo [2] Build Only
echo [3] Pubilsh Gitea
set "MODE="
set /p "MODE=请输入数字选择(回车默认 1): "
if "%MODE%"=="" set "MODE=1"
set "EXTRA="
if "%MODE%"=="2" (
set "EXTRA=-SkipPush"
) else if "%MODE%"=="3" (
set "EXTRA=-SkipBuild"
)
:: ---------- Gitea Token(仅完整发布模式需要) ----------
if "%MODE%"=="1" if not defined GITEA_TOKEN (
echo.
echo 未检测到环境变量 GITEA_TOKEN,上传到 Gitea 需要它。
echo 可在此临时输入(仅本次会话生效),留空则自动改为"只构建不上传"
set /p "GITEA_TOKEN=请输入 Gitea Token: "
if "!GITEA_TOKEN!"=="" (
set "EXTRA=-SkipPush"
set "MODE=2"
echo [提示] 已切换为"只构建并整理产物,不上传"
)
)
echo.
echo Startrelease.ps1 %VER_ARG% %EXTRA%
echo ------------------------------------------------
powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT%" %VER_ARG% %EXTRA%
set "RESULT=%ERRORLEVEL%"
echo.
if "%RESULT%"=="0" (
echo 执行完成。
) else (
echo 执行出错,请查看上方日志。
)
echo.
pause