From be8b2d2978ace56f3070e8a42f3ea01a08ee0f84 Mon Sep 17 00:00:00 2001 From: xushier Date: Thu, 27 Aug 2026 21:55:15 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9C=AC=E5=9C=B0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E7=A7=BB=E5=87=BA=E7=89=88=E6=9C=AC=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 8 ++++++++ publish.bat | 4 ---- publish.ps1 | 52 ---------------------------------------------------- 3 files changed, 8 insertions(+), 56 deletions(-) create mode 100644 .gitignore delete mode 100644 publish.bat delete mode 100644 publish.ps1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e6b1677 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +# 本地发布脚本(仅本机使用,不入库) +publish.bat +publish.ps1 + +# 系统杂项 +Thumbs.db +desktop.ini +.DS_Store diff --git a/publish.bat b/publish.bat deleted file mode 100644 index 4888e28..0000000 --- a/publish.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -chcp 65001 >nul -powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0publish.ps1" %* -pause diff --git a/publish.ps1 b/publish.ps1 deleted file mode 100644 index ac74ecb..0000000 --- a/publish.ps1 +++ /dev/null @@ -1,52 +0,0 @@ -# HD-Icons 一键发布脚本 -# 用法:把新图标放入 inbox/ 对应子文件夹后,双击 publish.bat(或运行本脚本) -# 可选参数:.\publish.ps1 -Message "自定义提交说明" - -param([string]$Message = "") - -$ErrorActionPreference = "Stop" -Set-Location $PSScriptRoot - -# 定位 git(git 不在 PATH 时使用常见安装路径) -$git = "git" -if (-not (Get-Command git -ErrorAction SilentlyContinue)) { - $fallback = "C:\Program Files\Git\cmd\git.exe" - if (Test-Path $fallback) { $git = $fallback } else { - Write-Host "[错误] 未找到 git,请安装 Git 或将其加入 PATH" -ForegroundColor Red - exit 1 - } -} - -# 检查 inbox 是否有新文件 -$inboxStatus = & $git status --porcelain -- inbox -if (-not $inboxStatus) { - Write-Host "inbox 中没有新图标,无需发布。" -ForegroundColor Yellow - exit 0 -} - -# 从文件名自动生成提交说明 -$names = @($inboxStatus | ForEach-Object { - $_.Substring(3).Trim() -replace '^inbox/', '' -} | ForEach-Object { [System.IO.Path]::GetFileNameWithoutExtension($_) -replace '-\d+$', '' } | Sort-Object -Unique) -$prefixes = ($names | Select-Object -First 8) -join ", " -if ($names.Count -gt 8) { $prefixes += " 等" } -$fileCount = ($inboxStatus | Measure-Object).Count -if (-not $Message) { - $Message = "新增 $fileCount 个图标:$prefixes" -} - -Write-Host "本次发布:$Message" -ForegroundColor Cyan -& $git add -A -& $git commit -m $Message -if ($LASTEXITCODE -ne 0) { - Write-Host "[错误] 提交失败" -ForegroundColor Red - exit 1 -} -& $git push -if ($LASTEXITCODE -ne 0) { - Write-Host "[错误] 推送失败,请检查网络或凭据" -ForegroundColor Red - exit 1 -} -Write-Host "" -Write-Host "已推送到 GitHub,Actions 将自动完成压缩、入库、索引、README 与预览图更新。" -ForegroundColor Green -Write-Host "进度查看:https://github.com/xushier/HD-Icons/actions"