фикс
This commit is contained in:
Binary file not shown.
@@ -1,2 +1,45 @@
|
|||||||
Copy publish.ps1, publish.cmd, publish-config.json to D:\TTRPG-Release\
|
TTRPG Release folder
|
||||||
when updating the release publisher tool.
|
|
||||||
|
====================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
RECOMMENDED WORKFLOW (same version on all platforms)
|
||||||
|
|
||||||
|
----------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
1) bump-version.cmd
|
||||||
|
|
||||||
|
OR in project: npm version patch --no-git-tag-version
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2) On Mac: npm ci && npm run build && npm run pack:mac
|
||||||
|
|
||||||
|
Copy to D:\TTRPG-Release:
|
||||||
|
|
||||||
|
latest-mac.yml, TTRPGPlayer-x64.zip, TTRPGPlayer-arm64.zip (+ dmg optional)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
3) release-all.cmd
|
||||||
|
|
||||||
|
- does NOT bump version (default -AfterMac)
|
||||||
|
|
||||||
|
- checks Mac files match package.json version
|
||||||
|
|
||||||
|
- builds Windows + Linux, copies artifacts, publishes to updates.mailib.ru
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LEGACY (Win/Linux ahead of Mac)
|
||||||
|
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
release-all-bump.cmd - bumps patch in script, build Win/Linux, publish with -SkipMac or add Mac later
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
SCRIPTS
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
@echo off
|
||||||
|
REM Bump patch in package.json only (no git tag). Run BEFORE Mac build.
|
||||||
|
cd /d "D:\Work\my_projects\dnd_project\dnd_player"
|
||||||
|
call npm version patch --no-git-tag-version
|
||||||
|
if errorlevel 1 pause & exit /b 1
|
||||||
|
echo.
|
||||||
|
echo Version bumped. Next:
|
||||||
|
echo 1) npm run pack:mac on Mac
|
||||||
|
echo 2) Copy latest-mac.yml + TTRPGPlayer-*.zip to D:\TTRPG-Release
|
||||||
|
echo 3) release-all.cmd
|
||||||
|
pause
|
||||||
@@ -1,17 +1,26 @@
|
|||||||
# Prepare TTRPG release: bump version, git push, build Win/Linux, copy to release folder.
|
# Prepare TTRPG release: build Win/Linux, copy to release folder.
|
||||||
# Run: prepare-release.cmd
|
# Run: prepare-release.cmd
|
||||||
|
#
|
||||||
|
# Recommended (Mac first, same version on all platforms):
|
||||||
|
# 1) Bump version in package.json manually (npm version patch --no-git-tag-version)
|
||||||
|
# 2) pack:mac on Mac, copy latest-mac.yml + *.zip to release folder
|
||||||
|
# 3) prepare-release.cmd -AfterMac (or release-all.cmd)
|
||||||
|
#
|
||||||
# Options:
|
# Options:
|
||||||
# -Version 1.0.17 explicit version (skip auto bump)
|
# -AfterMac do not bump; require Mac files in release folder (default in release-all)
|
||||||
# -Patch bump patch (default)
|
# -Bump bump patch before build (Mac can be added later)
|
||||||
# -Minor bump minor
|
# -Version 1.0.17 set explicit version (with -Bump workflow)
|
||||||
|
# -Minor bump minor (with -Bump)
|
||||||
# -SkipGit skip commit/push
|
# -SkipGit skip commit/push
|
||||||
# -SkipLinux skip Linux build (WSL)
|
# -SkipLinux skip Linux build (WSL)
|
||||||
# -NoBump do not change package.json version
|
# -NoBump do not change package.json (same as -AfterMac without Mac check)
|
||||||
|
|
||||||
param(
|
param(
|
||||||
[string]$Version = '',
|
[string]$Version = '',
|
||||||
[switch]$Patch,
|
[switch]$Patch,
|
||||||
[switch]$Minor,
|
[switch]$Minor,
|
||||||
|
[switch]$Bump,
|
||||||
|
[switch]$AfterMac,
|
||||||
[switch]$SkipGit,
|
[switch]$SkipGit,
|
||||||
[switch]$SkipLinux,
|
[switch]$SkipLinux,
|
||||||
[switch]$NoBump
|
[switch]$NoBump
|
||||||
@@ -149,6 +158,45 @@ function Push-Git([string]$ProjectRoot, [string]$Remote, [string]$McpConfigPath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-YmlField([string]$ymlPath, [string]$fieldName) {
|
||||||
|
$content = Get-Content -LiteralPath $ymlPath -Raw -Encoding UTF8
|
||||||
|
$m = [regex]::Match($content, "(?m)^${fieldName}:\s*(\S+)\s*$")
|
||||||
|
if ($m.Success) {
|
||||||
|
return $m.Groups[1].Value.Trim()
|
||||||
|
}
|
||||||
|
return $null
|
||||||
|
}
|
||||||
|
|
||||||
|
function Test-MacReleaseReady {
|
||||||
|
param(
|
||||||
|
[string]$ReleaseDir,
|
||||||
|
[string]$ExpectedVersion
|
||||||
|
)
|
||||||
|
$macYml = Join-Path $ReleaseDir 'latest-mac.yml'
|
||||||
|
if (-not (Test-Path -LiteralPath $macYml)) {
|
||||||
|
throw @"
|
||||||
|
AfterMac: missing latest-mac.yml in $ReleaseDir
|
||||||
|
1) Bump version in package.json (now $ExpectedVersion)
|
||||||
|
2) npm run pack:mac on Mac
|
||||||
|
3) Copy latest-mac.yml + TTRPGPlayer-*.zip into release folder
|
||||||
|
4) Run prepare-release.cmd -AfterMac again
|
||||||
|
"@
|
||||||
|
}
|
||||||
|
$macVersion = Get-YmlField $macYml 'version'
|
||||||
|
if ($macVersion -and $macVersion -ne $ExpectedVersion) {
|
||||||
|
throw "AfterMac: latest-mac.yml is v$macVersion but package.json is v$ExpectedVersion. Align versions before building Win/Linux."
|
||||||
|
}
|
||||||
|
$primary = Get-YmlField $macYml 'path'
|
||||||
|
if (-not $primary) {
|
||||||
|
throw 'AfterMac: latest-mac.yml has no path: entry'
|
||||||
|
}
|
||||||
|
$primaryPath = Join-Path $ReleaseDir $primary
|
||||||
|
if (-not (Test-Path -LiteralPath $primaryPath)) {
|
||||||
|
throw "AfterMac: missing Mac update file $primary (path in latest-mac.yml). Copy zip from Mac build."
|
||||||
|
}
|
||||||
|
Write-Ok "Mac feed v$ExpectedVersion, primary: $primary"
|
||||||
|
}
|
||||||
|
|
||||||
function Copy-ReleaseArtifacts {
|
function Copy-ReleaseArtifacts {
|
||||||
param(
|
param(
|
||||||
[string]$BuildReleaseDir,
|
[string]$BuildReleaseDir,
|
||||||
@@ -228,12 +276,36 @@ Write-Host '=== TTRPG Prepare Release ===' -ForegroundColor Cyan
|
|||||||
Write-Host "Project: $projectRoot"
|
Write-Host "Project: $projectRoot"
|
||||||
Write-Host "Release folder: $releaseDir"
|
Write-Host "Release folder: $releaseDir"
|
||||||
|
|
||||||
# Step 1 - version
|
if ($AfterMac) {
|
||||||
Write-Step 1 'Bump version'
|
$NoBump = $true
|
||||||
$currentVersion = Read-PackageVersion $packageJson
|
}
|
||||||
$newVersion = $currentVersion
|
if ($Bump -and $AfterMac) {
|
||||||
|
throw 'Use either -Bump or -AfterMac, not both'
|
||||||
|
}
|
||||||
|
if ($Bump) {
|
||||||
|
$Patch = $true
|
||||||
|
}
|
||||||
|
|
||||||
if ($NoBump) {
|
$currentVersion = Read-PackageVersion $packageJson
|
||||||
|
|
||||||
|
if ($AfterMac) {
|
||||||
|
Write-Step 0 'Mac artifacts check'
|
||||||
|
Test-MacReleaseReady $releaseDir $currentVersion
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 1 - version
|
||||||
|
if ($AfterMac) {
|
||||||
|
Write-Step 1 'Version (unchanged, Mac-first workflow)'
|
||||||
|
$newVersion = $currentVersion
|
||||||
|
Write-Ok "building Win/Linux at v$newVersion (same as Mac feed)"
|
||||||
|
} else {
|
||||||
|
Write-Step 1 'Bump version'
|
||||||
|
$newVersion = $currentVersion
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($AfterMac) {
|
||||||
|
# version step done above
|
||||||
|
} elseif ($NoBump) {
|
||||||
Write-Ok "version unchanged: $currentVersion"
|
Write-Ok "version unchanged: $currentVersion"
|
||||||
$newVersion = $currentVersion
|
$newVersion = $currentVersion
|
||||||
} elseif ($Version) {
|
} elseif ($Version) {
|
||||||
@@ -310,8 +382,12 @@ Write-Host '=== Prepare release done ===' -ForegroundColor Green
|
|||||||
Write-Host "Version: $newVersion"
|
Write-Host "Version: $newVersion"
|
||||||
Write-Host ''
|
Write-Host ''
|
||||||
Write-Host 'Next steps:' -ForegroundColor Yellow
|
Write-Host 'Next steps:' -ForegroundColor Yellow
|
||||||
Write-Host ' 1) Copy Mac files (latest-mac.yml, TTRPGPlayer-*.zip, optional *.dmg) from Mac into release folder if needed'
|
if ($AfterMac) {
|
||||||
Write-Host ' 2) Run publish.cmd to validate and upload to updates.mailib.ru'
|
Write-Host ' Run publish.cmd (release-all continues to publish automatically)'
|
||||||
|
} else {
|
||||||
|
Write-Host ' 1) Copy Mac files (latest-mac.yml, TTRPGPlayer-*.zip) from Mac into release folder'
|
||||||
|
Write-Host ' 2) Run release-all.cmd (default -AfterMac) or publish.cmd'
|
||||||
|
}
|
||||||
Write-Host ''
|
Write-Host ''
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
@echo off
|
||||||
|
REM Legacy: bump version in script, then Win/Linux (Mac files added later).
|
||||||
|
cd /d "%~dp0"
|
||||||
|
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0release-all.ps1" -Bump %*
|
||||||
|
if errorlevel 1 pause
|
||||||
@@ -1,13 +1,17 @@
|
|||||||
# Copy of D:\TTRPG-Release\release-all.ps1
|
# Full release: prepare (build Win/Linux, copy) then publish (validate + upload).
|
||||||
|
# Run: release-all.cmd (default: -AfterMac, version already set, Mac files in release folder)
|
||||||
|
# release-all-bump.cmd (bump version first, Mac later)
|
||||||
|
|
||||||
param(
|
param(
|
||||||
[string]$Version = '',
|
[string]$Version = '',
|
||||||
[switch]$Patch,
|
[switch]$Bump,
|
||||||
|
[switch]$AfterMac,
|
||||||
[switch]$Minor,
|
[switch]$Minor,
|
||||||
[switch]$SkipGit,
|
[switch]$SkipGit,
|
||||||
[switch]$SkipLinux,
|
[switch]$SkipLinux,
|
||||||
[switch]$NoBump,
|
[switch]$NoBump,
|
||||||
[switch]$CheckOnlyPublish
|
[switch]$CheckOnlyPublish,
|
||||||
|
[switch]$SkipMac
|
||||||
)
|
)
|
||||||
|
|
||||||
Set-StrictMode -Version Latest
|
Set-StrictMode -Version Latest
|
||||||
@@ -24,9 +28,18 @@ if (-not (Test-Path -LiteralPath $PublishScript)) {
|
|||||||
throw "Missing publish.ps1: $PublishScript"
|
throw "Missing publish.ps1: $PublishScript"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$useAfterMac = $AfterMac
|
||||||
|
if ($Bump -and $AfterMac) {
|
||||||
|
throw 'Use either -Bump or -AfterMac, not both'
|
||||||
|
}
|
||||||
|
if (-not $Bump -and -not $PSBoundParameters.ContainsKey('AfterMac')) {
|
||||||
|
$useAfterMac = $true
|
||||||
|
}
|
||||||
|
|
||||||
$prepareArgs = @()
|
$prepareArgs = @()
|
||||||
if ($Version) { $prepareArgs += '-Version', $Version }
|
if ($Version) { $prepareArgs += '-Version', $Version }
|
||||||
if ($Patch) { $prepareArgs += '-Patch' }
|
if ($Bump) { $prepareArgs += '-Bump' }
|
||||||
|
if ($useAfterMac) { $prepareArgs += '-AfterMac' }
|
||||||
if ($Minor) { $prepareArgs += '-Minor' }
|
if ($Minor) { $prepareArgs += '-Minor' }
|
||||||
if ($SkipGit) { $prepareArgs += '-SkipGit' }
|
if ($SkipGit) { $prepareArgs += '-SkipGit' }
|
||||||
if ($SkipLinux) { $prepareArgs += '-SkipLinux' }
|
if ($SkipLinux) { $prepareArgs += '-SkipLinux' }
|
||||||
@@ -34,6 +47,7 @@ if ($NoBump) { $prepareArgs += '-NoBump' }
|
|||||||
|
|
||||||
$publishArgs = @()
|
$publishArgs = @()
|
||||||
if ($CheckOnlyPublish) { $publishArgs += '-CheckOnly' }
|
if ($CheckOnlyPublish) { $publishArgs += '-CheckOnly' }
|
||||||
|
if ($SkipMac) { $publishArgs += '-SkipMac' }
|
||||||
|
|
||||||
Write-Host '=== TTRPG Full Release ===' -ForegroundColor Cyan
|
Write-Host '=== TTRPG Full Release ===' -ForegroundColor Cyan
|
||||||
Write-Host ''
|
Write-Host ''
|
||||||
|
|||||||
Reference in New Issue
Block a user