fix: add Windows installer and upload Windows CLI binaries to release
- Add install.ps1 PowerShell script for native Windows installation - Update install.sh to redirect Windows users (MINGW/MSYS/CYGWIN) to install.ps1 - Ignore CLI build artifacts (*.exe, *.zip, *.tar.gz) in .gitignore - Windows binaries (x86_64 + arm64) uploaded to v0.1.6 release Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,3 +43,6 @@ next-env.d.ts
|
|||||||
# CLI build artifacts
|
# CLI build artifacts
|
||||||
cli/transmute
|
cli/transmute
|
||||||
cli/*.pdf
|
cli/*.pdf
|
||||||
|
cli/*.exe
|
||||||
|
cli/*.zip
|
||||||
|
cli/*.tar.gz
|
||||||
|
|||||||
+99
@@ -0,0 +1,99 @@
|
|||||||
|
# Transmute CLI installer for Windows
|
||||||
|
# Usage: irm https://raw.githubusercontent.com/noauf/Transmute/main/install.ps1 | iex
|
||||||
|
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
$REPO = "noauf/Transmute"
|
||||||
|
$BINARY = "transmute"
|
||||||
|
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host " Transmute CLI installer"
|
||||||
|
Write-Host " ======================"
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
# Detect architecture
|
||||||
|
$ARCH = if ([System.Environment]::Is64BitOperatingSystem) {
|
||||||
|
if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { "arm64" } else { "x86_64" }
|
||||||
|
} else {
|
||||||
|
Write-Host " Error: 32-bit Windows is not supported" -ForegroundColor Red
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host " OS: windows"
|
||||||
|
Write-Host " Arch: $ARCH"
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
$ASSET = "$BINARY-windows-$ARCH.zip"
|
||||||
|
|
||||||
|
# Get latest release tag
|
||||||
|
Write-Host " Fetching latest release..."
|
||||||
|
try {
|
||||||
|
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/$REPO/releases/latest" -Headers @{ "User-Agent" = "transmute-installer" }
|
||||||
|
$TAG = $release.tag_name
|
||||||
|
} catch {
|
||||||
|
Write-Host " Error: could not fetch latest release: $_" -ForegroundColor Red
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not $TAG) {
|
||||||
|
Write-Host " Error: could not determine latest release" -ForegroundColor Red
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host " Latest version: $TAG"
|
||||||
|
|
||||||
|
$DOWNLOAD_URL = "https://github.com/$REPO/releases/download/$TAG/$ASSET"
|
||||||
|
|
||||||
|
# Create temp directory
|
||||||
|
$TMP_DIR = Join-Path $env:TEMP "transmute-install-$(Get-Random)"
|
||||||
|
New-Item -ItemType Directory -Path $TMP_DIR | Out-Null
|
||||||
|
|
||||||
|
try {
|
||||||
|
$ZIP_PATH = Join-Path $TMP_DIR $ASSET
|
||||||
|
|
||||||
|
Write-Host " Downloading $ASSET..."
|
||||||
|
Invoke-WebRequest -Uri $DOWNLOAD_URL -OutFile $ZIP_PATH -UseBasicParsing
|
||||||
|
|
||||||
|
Write-Host " Extracting..."
|
||||||
|
Expand-Archive -Path $ZIP_PATH -DestinationPath $TMP_DIR -Force
|
||||||
|
|
||||||
|
$EXE_NAME = "$BINARY.exe"
|
||||||
|
$EXE_SOURCE = Join-Path $TMP_DIR "$BINARY-windows-$ARCH.exe"
|
||||||
|
if (-not (Test-Path $EXE_SOURCE)) {
|
||||||
|
$EXE_SOURCE = Join-Path $TMP_DIR $EXE_NAME
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not (Test-Path $EXE_SOURCE)) {
|
||||||
|
Write-Host " Error: could not find $EXE_NAME in archive" -ForegroundColor Red
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Determine install directory
|
||||||
|
$INSTALL_DIR = "$env:LOCALAPPDATA\transmute\bin"
|
||||||
|
New-Item -ItemType Directory -Path $INSTALL_DIR -Force | Out-Null
|
||||||
|
|
||||||
|
$INSTALL_PATH = Join-Path $INSTALL_DIR $EXE_NAME
|
||||||
|
Copy-Item -Path $EXE_SOURCE -Destination $INSTALL_PATH -Force
|
||||||
|
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host " Installed transmute $TAG to $INSTALL_PATH"
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
# Add to PATH if not already there
|
||||||
|
$USER_PATH = [System.Environment]::GetEnvironmentVariable("PATH", "User")
|
||||||
|
if ($USER_PATH -notlike "*$INSTALL_DIR*") {
|
||||||
|
[System.Environment]::SetEnvironmentVariable("PATH", "$USER_PATH;$INSTALL_DIR", "User")
|
||||||
|
Write-Host " Added $INSTALL_DIR to your PATH."
|
||||||
|
Write-Host " Restart your terminal for the PATH change to take effect."
|
||||||
|
Write-Host ""
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host " Get started:"
|
||||||
|
Write-Host " transmute *.png Convert all PNGs"
|
||||||
|
Write-Host " transmute ./photos/ Convert all files in a directory"
|
||||||
|
Write-Host " transmute --help Show all options"
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
Remove-Item -Recurse -Force $TMP_DIR -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
+9
-1
@@ -11,7 +11,15 @@ OS="$(uname -s)"
|
|||||||
case "$OS" in
|
case "$OS" in
|
||||||
Darwin) OS="darwin" ;;
|
Darwin) OS="darwin" ;;
|
||||||
Linux) OS="linux" ;;
|
Linux) OS="linux" ;;
|
||||||
MINGW*|MSYS*|CYGWIN*) OS="windows" ;;
|
MINGW*|MSYS*|CYGWIN*)
|
||||||
|
echo ""
|
||||||
|
echo " Windows detected."
|
||||||
|
echo " Please use the PowerShell installer instead:"
|
||||||
|
echo ""
|
||||||
|
echo " irm https://raw.githubusercontent.com/noauf/Transmute/main/install.ps1 | iex"
|
||||||
|
echo ""
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Error: unsupported operating system: $OS"
|
echo "Error: unsupported operating system: $OS"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user