# PowerShell script to create game patches for itch.io distribution # Run this from the tekton-enet project root param( [Parameter(Mandatory=$true)] [string]$Version, [string]$GodotPath = "godot", [string]$OutputDir = ".\dist" ) Write-Host "=== Tekton Patch Creator ===" -ForegroundColor Cyan Write-Host "Creating patch for version: $Version" -ForegroundColor Yellow # Create output directory if (-not (Test-Path $OutputDir)) { New-Item -ItemType Directory -Path $OutputDir | Out-Null } $PckName = "tekton-local-$Version.pck" $PckPath = Join-Path $OutputDir $PckName # Update version file Write-Host "Updating version.txt..." -ForegroundColor Green Set-Content -Path ".\version.txt" -Value $Version # Export PCK only (no executable) Write-Host "Exporting PCK file..." -ForegroundColor Green Write-Host "Note: Run this export from the Godot editor or configure export preset first" # Generate checksums Write-Host "Generating checksums..." -ForegroundColor Green if (Test-Path $PckPath) { $md5 = (Get-FileHash -Path $PckPath -Algorithm MD5).Hash.ToLower() $sha256 = (Get-FileHash -Path $PckPath -Algorithm SHA256).Hash.ToLower() $size = (Get-Item $PckPath).Length Write-Host "MD5: $md5" -ForegroundColor White Write-Host "SHA256: $sha256" -ForegroundColor White Write-Host "Size: $size bytes" -ForegroundColor White # Generate JSON snippet for version.json $jsonSnippet = @" { "version": "$Version", "date": "$(Get-Date -Format 'yyyy-MM-dd')", "pck_url": "https://your-username.itch.io/tekton-local/files/$PckName", "pck_size": $size, "checksum_md5": "$md5", "checksum_sha256": "$sha256", "changelog": [ "Add your changelog items here" ], "required": false } "@ $snippetPath = Join-Path $OutputDir "release-$Version.json" Set-Content -Path $snippetPath -Value $jsonSnippet Write-Host "`nRelease JSON snippet saved to: $snippetPath" -ForegroundColor Green Write-Host "Copy this into your version.json releases array" -ForegroundColor Yellow } else { Write-Host "PCK file not found at: $PckPath" -ForegroundColor Red Write-Host "Please export the PCK manually from Godot:" -ForegroundColor Yellow Write-Host " 1. Open project in Godot Editor" -ForegroundColor White Write-Host " 2. Go to Project > Export..." -ForegroundColor White Write-Host " 3. Configure Windows Desktop preset" -ForegroundColor White Write-Host " 4. Click 'Export PCK/ZIP' and save as $PckName" -ForegroundColor White } Write-Host "`n=== Patch Creation Complete ===" -ForegroundColor Cyan Write-Host "Next steps:" -ForegroundColor Yellow Write-Host " 1. Upload $PckName to itch.io" -ForegroundColor White Write-Host " 2. Update version.json with the new release entry" -ForegroundColor White Write-Host " 3. Upload updated version.json to itch.io" -ForegroundColor White