-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuilt-light-release.ps1
More file actions
71 lines (61 loc) · 1.72 KB
/
built-light-release.ps1
File metadata and controls
71 lines (61 loc) · 1.72 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
66
67
68
69
70
71
# build-lite-release.ps1
<#
.SYNOPSIS
Builds a lightweight release ZIP of Mercury Framework containing only essential files.
.DESCRIPTION
Includes:
- Core Mercury framework (mercury/)
- Essential plugins (mercury_plugins/)
- Samples (samples/)
- Documentation (docs/, README.md, LICENSE, RESPONSIBLE_USE.md)
- Tools necessary for running
Excludes:
- CI workflows
- Tests
- Large optional binaries
.EXAMPLE
pwsh ./build-lite-release.ps1
#>
param (
[string]$OutputDir = "release",
[string]$ZipName = "mercury-framework-lite.zip"
)
# Resolve paths
$RootDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
$OutputPath = Join-Path -Path $RootDir -ChildPath $OutputDir
$ZipPath = Join-Path -Path $OutputPath -ChildPath $ZipName
# Ensure output directory exists
if (-Not (Test-Path $OutputPath)) {
New-Item -ItemType Directory -Path $OutputPath | Out-Null
}
# Files & directories to include
$IncludeItems = @(
"mercury",
"mercury_plugins",
"samples",
"docs",
"README.md",
"LICENSE",
"RESPONSIBLE_USE.md"
)
# Clean up old ZIP if exists
if (Test-Path $ZipPath) {
Remove-Item $ZipPath -Force
}
# Create ZIP (cross-platform)
Write-Host "Building lightweight ZIP..."
if ($IsWindows) {
# Windows: Use Compress-Archive
Compress-Archive -Path $IncludeItems -DestinationPath $ZipPath -Force
} else {
# Linux / macOS: Use zip command if available
if (Get-Command zip -ErrorAction SilentlyContinue) {
Push-Location $RootDir
zip -r $ZipPath $IncludeItems -x "*.git*" "*tests*" "*sandbox*" "*ci.yml*" -q
Pop-Location
} else {
Write-Error "zip command not found on this system. Please install zip utility."
exit 1
}
}
Write-Host "Lite ZIP created at: $ZipPath"