feat: add multi-platform packaging and auto-update infrastructure
- Add PyInstaller configuration (clide.spec) for cross-platform builds - Add build scripts for macOS (DMG), Linux (AppImage), and Windows (Inno Setup) - Add Gitea Actions CI/CD workflow for automated releases - Add auto-update service with Gitea API integration - Add 'clide update' CLI command for checking and installing updates Packaging outputs: - macOS: Signed/notarized .app bundle in DMG - Linux: Portable AppImage (glibc 2.17+) - Windows: Inno Setup installer Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
8b1a84e7e2
commit
aff03a2e9b
@@ -0,0 +1,102 @@
|
||||
# Build script for Windows installer distribution
|
||||
# Creates an installer using Inno Setup
|
||||
#
|
||||
# Prerequisites:
|
||||
# - Inno Setup 6: choco install innosetup -y
|
||||
# Or download from: https://jrsoftware.org/isinfo.php
|
||||
#
|
||||
# Usage: .\scripts\build-windows.ps1 [-Version "1.0.0"]
|
||||
|
||||
param(
|
||||
[string]$Version = "1.0.0"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "========================================"
|
||||
Write-Host "Building Clide $Version for Windows"
|
||||
Write-Host "========================================"
|
||||
|
||||
# Ensure we're in the project root
|
||||
$ProjectRoot = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
|
||||
Set-Location $ProjectRoot
|
||||
|
||||
# Build with PyInstaller
|
||||
Write-Host "Building with PyInstaller..."
|
||||
pyinstaller clide.spec --clean --noconfirm
|
||||
|
||||
# Check for Inno Setup
|
||||
$InnoSetup = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
|
||||
if (-not (Test-Path $InnoSetup)) {
|
||||
Write-Host ""
|
||||
Write-Host "Warning: Inno Setup not found at $InnoSetup"
|
||||
Write-Host "Install with: choco install innosetup -y"
|
||||
Write-Host "Or download from: https://jrsoftware.org/isinfo.php"
|
||||
Write-Host ""
|
||||
Write-Host "Skipping installer creation. Binary available at: dist\clide.exe"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Create Inno Setup script
|
||||
Write-Host "Creating Inno Setup script..."
|
||||
$InnoScript = @"
|
||||
; Clide Installer Script
|
||||
; Generated by build-windows.ps1
|
||||
|
||||
[Setup]
|
||||
AppName=Clide
|
||||
AppVersion=$Version
|
||||
AppPublisher=Clide
|
||||
AppPublisherURL=https://github.com/your-repo/clide
|
||||
AppSupportURL=https://github.com/your-repo/clide/issues
|
||||
DefaultDirName={autopf}\Clide
|
||||
DefaultGroupName=Clide
|
||||
AllowNoIcons=yes
|
||||
OutputDir=dist
|
||||
OutputBaseFilename=Clide-$Version-windows-setup
|
||||
Compression=lzma2
|
||||
SolidCompression=yes
|
||||
WizardStyle=modern
|
||||
PrivilegesRequired=lowest
|
||||
PrivilegesRequiredOverridesAllowed=dialog
|
||||
|
||||
[Languages]
|
||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
|
||||
[Files]
|
||||
Source: "dist\clide.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\Clide"; Filename: "{app}\clide.exe"
|
||||
Name: "{group}\{cm:UninstallProgram,Clide}"; Filename: "{uninstallexe}"
|
||||
Name: "{autodesktop}\Clide"; Filename: "{app}\clide.exe"; Tasks: desktopicon
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\clide.exe"; Description: "{cm:LaunchProgram,Clide}"; Flags: nowait postinstall skipifsilent shellexec
|
||||
|
||||
[Code]
|
||||
function InitializeSetup(): Boolean;
|
||||
begin
|
||||
Result := True;
|
||||
// Add any initialization checks here
|
||||
end;
|
||||
"@
|
||||
|
||||
# Write Inno Setup script
|
||||
$InnoScriptPath = Join-Path $ProjectRoot "build\clide.iss"
|
||||
$InnoScript | Out-File -FilePath $InnoScriptPath -Encoding UTF8
|
||||
|
||||
# Build installer
|
||||
Write-Host "Building installer with Inno Setup..."
|
||||
& $InnoSetup $InnoScriptPath
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "========================================"
|
||||
Write-Host "Build complete!"
|
||||
Write-Host "Output: dist\Clide-$Version-windows-setup.exe"
|
||||
Write-Host ""
|
||||
Write-Host "Note: For best experience, users should run Clide in Windows Terminal."
|
||||
Write-Host "========================================"
|
||||
Reference in New Issue
Block a user