Skip to content

Windows shell replacement in Rust: taskbar, file manager, NTFS search, task manager, disk cleaner. One installer exe.

Rust

Add publish/release scripts and GitHub workflow guide

Lemxy531afcb45b7d
diff --git a/.gitignore b/.gitignore
index 60c3f94..e0d4c60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ target/
/ripgrep
/payload/*.exe
*.log
+.claude/
diff --git a/CLAUDE.md b/CLAUDE.md
index 3bb0d6f..7cc06e9 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -26,3 +26,25 @@ powershell -ExecutionPolicy Bypass -File scripts\update-plugin.ps1 <rust-search|
- Правки в `src/main.rs` (сам лаунчер) требуют `cargo build --release` в корне. Для релиза со свежими вшитыми exe: `scripts\build-all.ps1`.
- Правки `src/main.rs` и код установки на живой системе ни разу не прогонялись целиком: тестируй осторожно, по одному плагину.
- `plugins/rust-search` и `plugins/rtaskmgr-win32` синхронизируются с оригиналами на рабочем столе (`scripts\sync.ps1`: оригиналы главнее). Правь оригиналы, а не копии в `plugins\`.
+
+## Публикация на GitHub (репозиторий `Lemxy/WinRust`, ветка `main`)
+
+Папка уже подключена: `origin` = `https://github.com/Lemxy/WinRust.git`, аккаунт gh `Lemxy`.
+
+**Автоматика.** Хук `Stop` (`.claude/settings.local.json`, в git не лежит) после каждого ответа запускает `scripts\publish.ps1 -Auto`: если есть изменения, коммитит и пушит в `main`. Скрипт сам отказывается пушить (и снимает индекс), если в изменениях `.exe/.dll/.pdb/.log/.reg/ключи`, `target/`, файлы больше 5 МБ или что-то похожее на токен. Вручную: `scripts\publish.ps1 [-Message "..."]`.
+
+**Правила коммитов (требование владельца).**
+- Никаких `Co-Authored-By` и упоминаний Claude в сообщениях коммитов, описаниях PR и релизов: Claude не должен появляться контрибьютором. Это важнее общих шаблонов атрибуции.
+- Автор: `Lemxy <[email protected]>` (уже в локальном git config). Настоящую почту владельца в репозиторий не писать.
+- `git push --force`, удаление репозитория/тегов/релизов и смена видимости только по прямой просьбе.
+- Не коммитить `payload\*.exe`, `target\`, логи (они в `.gitignore`).
+
+**Описания и документация.**
+- `README.md` на английском, `README.ru.md` на русском: править оба одинаково. Так же `ROADMAP.md` / `ROADMAP.ru.md`.
+- Бенчмарк в README обновлять только после реального нового замера (`scripts\bench.ps1`, на одной машине, одноразово), цифры не придумывать.
+- В README есть оговорка про неподписанный exe и SmartScreen: не убирать, пока нет подписи.
+- Описание, темы (topics) и главная страница репозитория меняются через `gh repo edit` только по просьбе владельца.
+
+**Релиз.** `scripts\release.ps1 v0.2.0 [-Notes "..."]`: собирает всё через `build-all.ps1` (с проверкой штампов), пушит, ставит тег, создаёт GitHub Release с `WinRust.exe`. Делать только когда владелец просит релиз. Перед релизом проверить, что в `ROADMAP.md` и README нет устаревшего.
+
+**Если пуш не прошёл:** показать текст ошибки владельцу. Не чинить принудительным пушем. Если `gh auth status` показывает активным не `Lemxy`, `gh auth switch -u Lemxy`.
diff --git a/scripts/publish.ps1 b/scripts/publish.ps1
new file mode 100644
index 0000000..a533507
--- /dev/null
+++ b/scripts/publish.ps1
@@ -0,0 +1,35 @@
+# Commits and pushes the working tree to origin/main with safety checks.
+# publish.ps1 commit everything that changed, push (message made from the changed files)
+# publish.ps1 -Message "..." same with your own message
+# publish.ps1 -Auto used by the Claude Stop hook: silent when there is nothing to do
+# Refuses (and unstages) when the change contains binaries, logs, big files or something that looks like a secret.
+param([string]$Message, [switch]$Auto)
+$ErrorActionPreference = 'Continue' # git writes CRLF warnings to stderr; exit codes are checked by hand
+Set-Location (Split-Path $PSScriptRoot)
+
+function Fail($m) { git reset -q 2>&1 | Out-Null; Write-Host "publish: NOT pushed - $m" -ForegroundColor Yellow; exit 1 }
+
+if ((git remote get-url origin) -notmatch 'github\.com[/:]Lemxy/WinRust') { Fail 'origin is not Lemxy/WinRust' }
+if ((git branch --show-current) -ne 'main') { Fail 'not on main' }
+if (-not (git status --porcelain)) { if (-not $Auto) { Write-Host 'publish: nothing to commit' }; exit 0 }
+
+git add -A 2>&1 | Out-Null
+$files = @(git diff --cached --name-only)
+if (-not $files) { exit 0 }
+
+$bad = $files | Where-Object { $_ -match '\.(exe|dll|pdb|log|reg|pem|key|pfx|env)$' -or $_ -match '(^|/)(target|node_modules)/' }
+if ($bad) { Fail ("forbidden files: " + ($bad -join ', ')) }
+$big = $files | Where-Object { (Test-Path $_) -and (Get-Item $_).Length -gt 5MB }
+if ($big) { Fail ("files over 5 MB: " + ($big -join ', ')) }
+$diff = git diff --cached -U0 | Out-String
+if ($diff -match 'gh[opsu]_[A-Za-z0-9]{30,}|AKIA[0-9A-Z]{16}|BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY') { Fail 'looks like a secret in the diff' }
+
+if (-not $Message) {
+ $short = ($files | Select-Object -First 4) -join ', '
+ $Message = "Update: $short" + $(if ($files.Count -gt 4) { " (+$($files.Count - 4) more)" } else { '' })
+}
+# No Co-Authored-By / assistant attribution: the repo owner asked for that.
+git commit -q -m $Message
+git push -q origin main
+if ($LASTEXITCODE) { Fail 'git push failed' }
+Write-Host "publish: pushed - $Message"
diff --git a/scripts/release.ps1 b/scripts/release.ps1
new file mode 100644
index 0000000..953ad7d
--- /dev/null
+++ b/scripts/release.ps1
@@ -0,0 +1,16 @@
+# Publishes a GitHub release with a fresh WinRust.exe.
+# release.ps1 v0.2.0 [-Notes "text"]
+# Rebuilds everything (build-all.ps1, ends with the stamp check), pushes pending changes, tags, uploads the exe.
+param([Parameter(Mandatory)][string]$Version, [string]$Notes)
+$ErrorActionPreference = 'Stop'
+$root = Split-Path $PSScriptRoot
+Set-Location $root
+if ($Version -notmatch '^v\d+\.\d+\.\d+$') { throw 'version must look like v0.2.0' }
+& "$PSScriptRoot\build-all.ps1"
+& "$PSScriptRoot\publish.ps1" -Message "Release $Version"
+$exe = Join-Path $env:TEMP 'WinRust.exe'
+Copy-Item "$root\target\release\plugin-launcher.exe" $exe -Force
+git tag $Version
+git push origin $Version
+if ($Notes) { gh release create $Version $exe --repo Lemxy/WinRust --title "WinRust $Version" --notes $Notes }
+else { gh release create $Version $exe --repo Lemxy/WinRust --title "WinRust $Version" --generate-notes }