chore: 新版构建部署流程

This commit is contained in:
lzh
2025-12-23 14:13:20 +08:00
parent e508bd692d
commit e52ffe7375
2 changed files with 12 additions and 8 deletions

View File

@@ -49,11 +49,12 @@ Write-Host "Build size: $buildSizeRounded MB" -ForegroundColor Cyan
$response = Read-Host "Do you want to commit and push to repository? (y/n)"
if ($response -eq "y" -or $response -eq "Y") {
$gitStatus = git status --porcelain
if ($gitStatus) {
# 只检查 dist 目录的变化,不检查其他文件
$distStatus = git status --porcelain apps/web-antd/dist
if ($distStatus) {
Write-Host "Staging build artifacts..." -ForegroundColor Yellow
# 只添加 dist 目录,不添加其他文件
git add -f apps/web-antd/dist
git add -A
Write-Host "Committing changes..." -ForegroundColor Yellow
# 使用 --no-verify 跳过 pre-commit hooks避免检查大量构建产物文件
@@ -66,7 +67,8 @@ if ($response -eq "y" -or $response -eq "Y") {
Write-Host "Build artifacts pushed successfully!" -ForegroundColor Green
Write-Host "Waiting for CI/CD to deploy..." -ForegroundColor Cyan
} else {
Write-Host "No changes to commit" -ForegroundColor Yellow
Write-Host "No changes in dist directory to commit" -ForegroundColor Yellow
Write-Host "Note: Only dist directory changes will be committed, other files are ignored" -ForegroundColor Cyan
}
} else {
Write-Host "Skipping git push. You can manually commit and push later." -ForegroundColor Yellow

View File

@@ -45,12 +45,13 @@ echo "📊 Build size: $BUILD_SIZE"
read -p "Do you want to commit and push to repository? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
# 检查是否有未提交的更改
if [ -n "$(git status --porcelain)" ]; then
# 检查 dist 目录的变化,不检查其他文件
DIST_STATUS=$(git status --porcelain apps/web-antd/dist)
if [ -n "$DIST_STATUS" ]; then
echo "📝 Staging build artifacts..."
# 只添加 dist 目录,不添加其他文件
# 使用 -f 强制添加被 .gitignore 忽略的 dist 目录
git add -f apps/web-antd/dist
git add -A # 添加其他更改
echo "💾 Committing changes..."
# 使用 --no-verify 跳过 pre-commit hooks避免检查大量构建产物文件
@@ -63,7 +64,8 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "✅ Build artifacts pushed successfully!"
echo "⏳ Waiting for CI/CD to deploy..."
else
echo " No changes to commit"
echo " No changes in dist directory to commit"
echo "Note: Only dist directory changes will be committed, other files are ignored"
fi
else
echo " Skipping git push. You can manually commit and push later."