-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-release.ps1
More file actions
66 lines (53 loc) · 2 KB
/
create-release.ps1
File metadata and controls
66 lines (53 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# PowerShell script to build and package release versions of dividex for Windows
# Usage: .\create-release.ps1 [version]
# Example: .\create-release.ps1 1.0.0
param(
[string]$Version = "1.0.0"
)
$ErrorActionPreference = "Stop"
Write-Host "Building release version of dividex for Windows (v$Version)..." -ForegroundColor Cyan
Write-Host ""
# Build in Release mode
dotnet build -c Release -f net10.0-windows10.0.19041.0
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ Build failed. Please fix errors and try again." -ForegroundColor Red
exit 1
}
Write-Host ""
Write-Host "✓ Build successful!" -ForegroundColor Green
Write-Host ""
# Find the Windows output directory
$ReleaseDir = "bin\Release\net10.0-windows10.0.19041.0"
$OutputDirs = @("win-x64", "win-x86", "win-arm64")
$WinOutputDir = $null
foreach ($rid in $OutputDirs) {
$exePath = Join-Path $ReleaseDir $rid "dividex.exe"
if (Test-Path $exePath) {
$WinOutputDir = Join-Path $ReleaseDir $rid
break
}
}
if ($null -eq $WinOutputDir -or -not (Test-Path (Join-Path $WinOutputDir "dividex.exe"))) {
Write-Host "❌ Windows executable not found. Searched in: $ReleaseDir" -ForegroundColor Red
exit 1
}
$ZipFile = "dividex-windows-v$Version.zip"
Write-Host "Creating Windows release package..." -ForegroundColor Cyan
Set-Location $WinOutputDir
Compress-Archive -Path * -DestinationPath "..\..\..\..\$ZipFile" -Force
Set-Location "..\..\..\.."
if ($LASTEXITCODE -eq 0) {
Write-Host "✓ Release package created: $ZipFile" -ForegroundColor Green
Write-Host ""
Write-Host "Next steps:" -ForegroundColor Yellow
Write-Host " 1. Go to your GitHub repository"
Write-Host " 2. Click 'Releases' → 'Create a new release'"
Write-Host " 3. Tag version: v$Version"
Write-Host " 4. Release title: dividex v$Version - Windows"
Write-Host " 5. Upload: $ZipFile"
Write-Host " 6. Add release notes and publish"
Write-Host ""
} else {
Write-Host "❌ Failed to create zip file" -ForegroundColor Red
exit 1
}