chore(release): point updater feed at updates.mailib.ru (v1.0.16)
Set build.publish.url to the production HTTPS feed, bump version to 1.0.16, add publish-to-updates.ps1 for VPS upload, and normalize Linux AppImage names from x86_64 to x64 after pack:linux. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+20
-23
@@ -2,17 +2,18 @@
|
|||||||
|
|
||||||
## Сборка и публикация
|
## Сборка и публикация
|
||||||
|
|
||||||
- Релизы собираются **локально** (без CI в Gitea).
|
- Релизы собираются **локально** (CI отключён).
|
||||||
- Файлы для выкладки кладутся в одну папку на Windows, затем заливаются на VPS (вручную `scp` или утилита **TTRPG Release Publisher** — в разработке).
|
- Артефакты кладутся в `D:\TTRPG-Release\` (или копируются из `release\` после сборки).
|
||||||
|
- Публикация на VPS: `powershell -ExecutionPolicy Bypass -File scripts\publish-to-updates.ps1`
|
||||||
- **Имена файлов без версии** — версия только в `latest*.yml`.
|
- **Имена файлов без версии** — версия только в `latest*.yml`.
|
||||||
|
|
||||||
## URL feed
|
## Feed URL
|
||||||
|
|
||||||
В `package.json` → `build.publish.url` должен быть реальный HTTPS-origin со **слэшем в конце**, например:
|
В `package.json` → `build.publish.url`:
|
||||||
|
|
||||||
`https://updates.mailib.ru/`
|
`https://updates.mailib.ru/`
|
||||||
|
|
||||||
Пока стоит заглушка `https://updates.invalid.ttrpg/` — автообновление в установленной сборке не заработает, пока не соберёте релиз с правильным URL.
|
Обязателен **слэш в конце**. URL вшивается в установщик при `npm run pack:win`.
|
||||||
|
|
||||||
## Фиксированные имена артефактов
|
## Фиксированные имена артефактов
|
||||||
|
|
||||||
@@ -20,36 +21,32 @@
|
|||||||
|-----------|--------|
|
|-----------|--------|
|
||||||
| Windows | `latest.yml`, `TTRPGPlayer-Setup.exe`, `TTRPGPlayer-Setup.exe.blockmap` |
|
| Windows | `latest.yml`, `TTRPGPlayer-Setup.exe`, `TTRPGPlayer-Setup.exe.blockmap` |
|
||||||
| Linux | `latest-linux.yml`, `TTRPGPlayer-x64.AppImage`, `TTRPGPlayer-arm64.AppImage` |
|
| Linux | `latest-linux.yml`, `TTRPGPlayer-x64.AppImage`, `TTRPGPlayer-arm64.AppImage` |
|
||||||
| macOS | `latest-mac.yml`, `TTRPGPlayer-x64.dmg`, `TTRPGPlayer-arm64.dmg` (при двух архитектурах) |
|
| macOS | `latest-mac.yml`, `TTRPGPlayer-x64.dmg`, `TTRPGPlayer-arm64.dmg` |
|
||||||
|
|
||||||
Номер версии (`1.0.16`) — в поле `version` внутри `latest*.yml`, не в имени файла.
|
|
||||||
|
|
||||||
## Локальная сборка
|
## Локальная сборка
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm ci
|
npm ci
|
||||||
npm run build
|
npm run build
|
||||||
npm run release:info # версия и пример тега vX.Y.Z (тег опционален, для git)
|
npm run release:info
|
||||||
```
|
```
|
||||||
|
|
||||||
| Команда | Где запускать | Результат |
|
| Команда | Где | Результат |
|
||||||
|---------|---------------|-----------|
|
|---------|-----|-----------|
|
||||||
| `npm run pack:win` | Windows | `release/` — Win + `latest.yml` |
|
| `npm run pack:win` | Windows | `release\` — Win + `latest.yml` |
|
||||||
| `npm run pack:linux` | Linux или WSL с зависимостями | `release/` — AppImage x64/arm64 + `latest-linux.yml` |
|
| `npm run pack:linux` | Linux / WSL | AppImage + `latest-linux*.yml` |
|
||||||
| `npm run pack:mac` | macOS | `release/` — dmg + `latest-mac.yml` |
|
| `npm run pack:mac` | macOS | dmg + `latest-mac.yml` |
|
||||||
|
|
||||||
Linux AppImage не собирается напрямую из Windows PowerShell: `mksquashfs` — Linux-инструмент. На Windows запускайте команду внутри WSL.
|
Linux из PowerShell напрямую не собирается — только WSL/Linux (`scripts/release-linux-pack.mjs`).
|
||||||
|
|
||||||
Скопируйте нужные файлы из `release/` в папку публикации (например `D:\TTRPG-Release\`).
|
После `pack:win` скопируйте из `release\` в `D:\TTRPG-Release\` файлы из таблицы выше.
|
||||||
|
|
||||||
## Сервер обновлений
|
## Сервер
|
||||||
|
|
||||||
Статический VPS (nginx + HTTPS), каталог `/var/www/ttrpg-updates/`. Подробная пошаговая настройка — в переписке / отдельной инструкции для `updates.mailib.ru`.
|
- Домен: `https://updates.mailib.ru/`
|
||||||
|
- nginx `root`: `/var/www/updates_mailib_ru`
|
||||||
|
- Проверка: `curl https://updates.mailib.ru/latest.yml`
|
||||||
|
|
||||||
## Лицензия
|
## Лицензия
|
||||||
|
|
||||||
Проверка обновлений только при активной лицензии. Ключи на клиенте: `TTRPG-…` и устаревшие `DND-…`.
|
Обновления доступны при активной лицензии. Ключи: `TTRPG-…` и устаревшие `DND-…`.
|
||||||
|
|
||||||
## Устаревшая схема
|
|
||||||
|
|
||||||
Git-репозиторий **`DndGamePlayerUpdates`** и CI-пуш артефактов **не используются**.
|
|
||||||
|
|||||||
+4
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "TTRPGPlayer",
|
"name": "TTRPGPlayer",
|
||||||
"version": "1.0.15",
|
"version": "1.0.16",
|
||||||
"description": "TTRPG Player — редактор и проигрыватель НРИ",
|
"description": "TTRPG Player — редактор и проигрыватель НРИ",
|
||||||
"main": "dist/main/index.cjs",
|
"main": "dist/main/index.cjs",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -19,7 +19,8 @@
|
|||||||
"pack:dir": "npm run build && node scripts/release-win-prep.mjs && electron-builder --dir",
|
"pack:dir": "npm run build && node scripts/release-win-prep.mjs && electron-builder --dir",
|
||||||
"pack:mac": "npm run build && electron-builder --mac",
|
"pack:mac": "npm run build && electron-builder --mac",
|
||||||
"pack:win": "npm run build && node scripts/release-win-prep.mjs && electron-builder --win",
|
"pack:win": "npm run build && node scripts/release-win-prep.mjs && electron-builder --win",
|
||||||
"pack:linux": "node scripts/release-linux-pack.mjs"
|
"pack:linux": "node scripts/release-linux-pack.mjs",
|
||||||
|
"publish:updates": "powershell -ExecutionPolicy Bypass -File scripts/publish-to-updates.ps1"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
@@ -165,7 +166,7 @@
|
|||||||
},
|
},
|
||||||
"publish": {
|
"publish": {
|
||||||
"provider": "generic",
|
"provider": "generic",
|
||||||
"url": "https://updates.invalid.ttrpg/"
|
"url": "https://updates.mailib.ru/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
# Заливка релиза на https://updates.mailib.ru/ (nginx root: /var/www/updates_mailib_ru)
|
||||||
|
# Использование:
|
||||||
|
# 1) Положите артефакты в $LocalDir (или соберите pack:win и скопируйте из release\)
|
||||||
|
# 2) powershell -ExecutionPolicy Bypass -File scripts\publish-to-updates.ps1
|
||||||
|
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
|
$Key = "$env:USERPROFILE\.ssh\ttrpg_updates_root"
|
||||||
|
$LocalDir = 'D:\TTRPG-Release'
|
||||||
|
$SshTarget = 'root@185.173.94.234'
|
||||||
|
$RemoteDir = '/var/www/updates_mailib_ru'
|
||||||
|
|
||||||
|
if (-not (Test-Path $Key)) {
|
||||||
|
Write-Error "SSH key not found: $Key"
|
||||||
|
}
|
||||||
|
if (-not (Test-Path $LocalDir)) {
|
||||||
|
Write-Error "Local release folder not found: $LocalDir"
|
||||||
|
}
|
||||||
|
|
||||||
|
$patterns = @(
|
||||||
|
'latest.yml',
|
||||||
|
'latest-linux*.yml',
|
||||||
|
'latest-mac.yml',
|
||||||
|
'TTRPGPlayer-Setup.exe',
|
||||||
|
'TTRPGPlayer-Setup.exe.blockmap',
|
||||||
|
'TTRPGPlayer-x64.AppImage',
|
||||||
|
'TTRPGPlayer-x86_64.AppImage',
|
||||||
|
'TTRPGPlayer-arm64.AppImage',
|
||||||
|
'TTRPGPlayer-x64.dmg',
|
||||||
|
'TTRPGPlayer-arm64.dmg'
|
||||||
|
)
|
||||||
|
|
||||||
|
$files = @()
|
||||||
|
foreach ($pat in $patterns) {
|
||||||
|
$files += Get-ChildItem -Path $LocalDir -Filter $pat -File -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
|
$files = $files | Sort-Object -Property Name -Unique
|
||||||
|
|
||||||
|
if (-not $files) {
|
||||||
|
Write-Error "No release files matched in $LocalDir"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Uploading to ${SshTarget}:${RemoteDir}"
|
||||||
|
foreach ($f in $files) {
|
||||||
|
Write-Host " -> $($f.Name)"
|
||||||
|
& scp -i $Key $f.FullName "${SshTarget}:${RemoteDir}/"
|
||||||
|
}
|
||||||
|
|
||||||
|
& ssh -i $Key $SshTarget "chown -R www-data:www-data $RemoteDir && ls -la $RemoteDir"
|
||||||
|
|
||||||
|
Write-Host ''
|
||||||
|
Write-Host 'Verify:'
|
||||||
|
Write-Host ' curl https://updates.mailib.ru/latest.yml'
|
||||||
@@ -6,6 +6,8 @@
|
|||||||
* the AppImage. Build from Linux/WSL instead.
|
* the AppImage. Build from Linux/WSL instead.
|
||||||
*/
|
*/
|
||||||
import { spawnSync } from 'node:child_process';
|
import { spawnSync } from 'node:child_process';
|
||||||
|
import fs from 'node:fs';
|
||||||
|
import path from 'node:path';
|
||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
|
|
||||||
function run(command, args) {
|
function run(command, args) {
|
||||||
@@ -19,6 +21,33 @@ function run(command, args) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** electron-builder для AppImage x64 часто даёт `x86_64` в имени — выравниваем под feed. */
|
||||||
|
function normalizeLinuxReleaseNames() {
|
||||||
|
const releaseDir = path.resolve('release');
|
||||||
|
if (!fs.existsSync(releaseDir)) return;
|
||||||
|
|
||||||
|
for (const name of fs.readdirSync(releaseDir)) {
|
||||||
|
if (!name.includes('x86_64')) continue;
|
||||||
|
const from = path.join(releaseDir, name);
|
||||||
|
const to = path.join(releaseDir, name.replaceAll('x86_64', 'x64'));
|
||||||
|
if (from !== to && !fs.existsSync(to)) {
|
||||||
|
fs.renameSync(from, to);
|
||||||
|
console.log(`[pack:linux] renamed ${name} -> ${path.basename(to)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const ymlName of fs.readdirSync(releaseDir)) {
|
||||||
|
if (!ymlName.startsWith('latest-linux') || !ymlName.endsWith('.yml')) continue;
|
||||||
|
const ymlPath = path.join(releaseDir, ymlName);
|
||||||
|
const text = fs.readFileSync(ymlPath, 'utf8');
|
||||||
|
const next = text.replaceAll('x86_64', 'x64');
|
||||||
|
if (next !== text) {
|
||||||
|
fs.writeFileSync(ymlPath, next);
|
||||||
|
console.log(`[pack:linux] patched ${ymlName} (x86_64 -> x64)`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
console.error(
|
console.error(
|
||||||
[
|
[
|
||||||
@@ -35,3 +64,4 @@ if (process.platform === 'win32') {
|
|||||||
|
|
||||||
run('npm', ['run', 'build']);
|
run('npm', ['run', 'build']);
|
||||||
run('electron-builder', ['--linux']);
|
run('electron-builder', ['--linux']);
|
||||||
|
normalizeLinuxReleaseNames();
|
||||||
|
|||||||
Reference in New Issue
Block a user