Add Gitea Actions CI/CD pipeline
Build and Release / Validate source (push) Failing after 25s
Build and Release / Build (linux) (push) Has been skipped
Build and Release / Create Release (push) Has been skipped
Build and Release / Build (windows) (push) Has been skipped

- .gitea/workflows/release.yml — multi-platform build (linux native + windows cross via wine)
- requirements.txt — all pip dependencies with version pins
- PKGBUILD — Arch Linux build reference
- build-scripts/build-linux-portable.sh — Linux portable/AppImage builder
- build-scripts/build-windows.ps1 — Windows PyInstaller + Inno Setup builder
This commit is contained in:
2026-06-27 03:26:18 +03:00
parent 4886f06d36
commit 586160b1a0
5 changed files with 704 additions and 0 deletions
+133
View File
@@ -0,0 +1,133 @@
#!/usr/bin/env bash
# =============================================================================
# Warlock Studio — Linux Portable Build Script
# =============================================================================
# Builds a portable AppDir/AppImage or tar.gz of the PyInstaller output.
#
# Usage:
# ./build-scripts/build-linux-portable.sh [--appimage] [--output-dir=./dist]
#
# Requires: python3, pip, pyinstaller, (optional: appimagetool for --appimage)
# =============================================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
cd "$PROJECT_DIR"
APP_NAME="Warlock-Studio"
BUILD_DIR="dist"
OUTPUT_DIR="${PROJECT_DIR}/${BUILD_DIR}"
# ---- Parse arguments ----
BUILD_APPIMAGE=false
while [[ $# -gt 0 ]]; do
case "$1" in
--appimage) BUILD_APPIMAGE=true; shift ;;
--output-dir=*) OUTPUT_DIR="${1#*=}"; shift ;;
--output-dir) OUTPUT_DIR="$2"; shift 2 ;;
*) echo "Unknown option: $1"; exit 1 ;;
esac
done
echo "=========================================="
echo " Warlock Studio — Linux Build"
echo "=========================================="
# ---- Step 1: Install system dependencies ----
echo "[1/5] Checking system dependencies..."
for cmd in python3 pip3; do
if ! command -v "$cmd" &>/dev/null; then
echo "ERROR: $cmd not found. Install python3 and pip."
exit 1
fi
done
# ---- Step 2: Install Python dependencies ----
echo "[2/5] Installing Python dependencies..."
pip3 install --upgrade pip wheel setuptools
pip3 install -r "${PROJECT_DIR}/requirements.txt"
pip3 install pyinstaller
# ---- Step 3: Build with PyInstaller ----
echo "[3/5] Building with PyInstaller..."
pyinstaller "${PROJECT_DIR}/Warlock-Studio.spec" --noconfirm --distpath "${OUTPUT_DIR}"
# Verify the binary was created
if [ -f "${OUTPUT_DIR}/${APP_NAME}/${APP_NAME}" ]; then
echo " Binary: ${OUTPUT_DIR}/${APP_NAME}/${APP_NAME}"
file "${OUTPUT_DIR}/${APP_NAME}/${APP_NAME}"
elif [ -f "${OUTPUT_DIR}/${APP_NAME}/${APP_NAME}.exe" ]; then
echo " Binary: ${OUTPUT_DIR}/${APP_NAME}/${APP_NAME}.exe"
else
echo "ERROR: Build output not found at ${OUTPUT_DIR}/${APP_NAME}/"
ls -la "${OUTPUT_DIR}/${APP_NAME}" 2>/dev/null || echo " (directory missing)"
exit 1
fi
# ---- Step 4: Create portable tar.gz ----
echo "[4/5] Creating portable tar.gz..."
VERSION=""
if [ -n "${CI_COMMIT_TAG:-}" ]; then
VERSION="${CI_COMMIT_TAG#v}"
elif command -v git &>/dev/null; then
VERSION="$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")"
VERSION="${VERSION#v}"
fi
[ -z "$VERSION" ] && VERSION="dev"
ARCHIVE_NAME="${APP_NAME}-${VERSION}-linux-x64.tar.gz"
tar -czf "${ARCHIVE_NAME}" -C "${OUTPUT_DIR}" "${APP_NAME}"
echo " Archive: ${ARCHIVE_NAME} ($(du -h "${ARCHIVE_NAME}" | cut -f1))"
# ---- Step 5: Optionally build AppImage ----
if [ "$BUILD_APPIMAGE" = true ]; then
echo "[5/5] Creating AppImage..."
if ! command -v appimagetool &>/dev/null && [ ! -f "appimagetool" ]; then
echo " Downloading appimagetool..."
wget -q "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -O appimagetool
chmod +x appimagetool
fi
APPIMAGETOOL=$(command -v appimagetool || echo "./appimagetool")
# Create AppDir structure
APPDIR="${OUTPUT_DIR}/${APP_NAME}.AppDir"
mkdir -p "${APPDIR}/usr/bin"
cp -r "${OUTPUT_DIR}/${APP_NAME}"/* "${APPDIR}/usr/bin/"
# Create desktop entry
cat > "${APPDIR}/${APP_NAME}.desktop" << EOF
[Desktop Entry]
Name=Warlock Studio
Comment=AI-powered video upscaling, restoration and frame interpolation
Exec=${APP_NAME}
Icon=${APP_NAME}
Terminal=false
Type=Application
Categories=Graphics;Video;
EOF
# Copy icon
cp "${PROJECT_DIR}/logo.ico" "${APPDIR}/${APP_NAME}.png" 2>/dev/null || true
# Create AppRun
cat > "${APPDIR}/AppRun" << 'APPRUN_EOF'
#!/usr/bin/env bash
HERE="$(dirname "$(readlink -f "$0")")"
export PATH="${HERE}/usr/bin:${PATH}"
export LD_LIBRARY_PATH="${HERE}/usr/bin/_internal:${LD_LIBRARY_PATH}"
exec "${HERE}/usr/bin/Warlock-Studio" "$@"
APPRUN_EOF
chmod +x "${APPDIR}/AppRun"
# Build AppImage
ARCH=x86_64 "$APPIMAGETOOL" "${APPDIR}" "${APP_NAME}-${VERSION}-x86_64.AppImage"
echo " AppImage: ${APP_NAME}-${VERSION}-x86_64.AppImage"
fi
echo ""
echo "=========================================="
echo " BUILD COMPLETE"
echo "=========================================="
echo "Output: ${ARCHIVE_NAME}"
[ "$BUILD_APPIMAGE" = true ] && echo "AppImage: ${APP_NAME}-${VERSION}-x86_64.AppImage"
+102
View File
@@ -0,0 +1,102 @@
# =============================================================================
# Warlock Studio — Windows Build Script (PowerShell)
# =============================================================================
# Builds with PyInstaller and optionally packages into an installer via Inno Setup.
#
# Usage:
# .\build-scripts\build-windows.ps1 [-InnoSetup] [-OutputDir .\dist]
#
# Requires: Python 3.10+, pip, PyInstaller
# Optional: Inno Setup (for -InnoSetup flag)
# =============================================================================
param(
[switch]$InnoSetup,
[string]$OutputDir = (Join-Path (Get-Location) "dist")
)
$ErrorActionPreference = "Stop"
$ProjectRoot = Split-Path -Parent (Split-Path -Parent $PSCommandPath)
$AppName = "Warlock-Studio"
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host " Warlock Studio — Windows Build" -ForegroundColor Cyan
Write-Host "==========================================" -ForegroundColor Cyan
# ---- Step 1: Install Python dependencies ----
Write-Host "[1/5] Installing Python dependencies..." -ForegroundColor Yellow
python -m pip install --upgrade pip wheel setuptools
pip install -r (Join-Path $ProjectRoot "requirements.txt")
pip install pyinstaller onnxruntime-directml
# ---- Step 2: Build with PyInstaller ----
Write-Host "[2/5] Building with PyInstaller..." -ForegroundColor Yellow
$specFile = Join-Path $ProjectRoot "Warlock-Studio.spec"
$distPath = $OutputDir
pyinstaller $specFile --noconfirm --distpath $distPath
# Verify output
$binaryPath = Join-Path $distPath $AppName "$AppName.exe"
if (-not (Test-Path $binaryPath)) {
Write-Error "Build failed: $binaryPath not found"
exit 1
}
Write-Host " Binary: $binaryPath" -ForegroundColor Green
# ---- Step 3: Create versioned archive ----
Write-Host "[3/5] Creating ZIP archive..." -ForegroundColor Yellow
$version = "dev"
$tag = git describe --tags --abbrev=0 2>$null
if ($tag) { $version = $tag.TrimStart('v') }
$archiveName = "$AppName-$version-win64.zip"
$archivePath = Join-Path $ProjectRoot $archiveName
$buildDir = Join-Path $distPath $AppName
Compress-Archive -Path "$buildDir\*" -DestinationPath $archivePath -Force
Write-Host " Archive: $archivePath" -ForegroundColor Green
# ---- Step 4: Build Inno Setup installer (optional) ----
if ($InnoSetup) {
Write-Host "[4/5] Building Inno Setup installer..." -ForegroundColor Yellow
# Check if ISCC is available
$iscc = Get-Command "iscc" -ErrorAction SilentlyContinue
if (-not $iscc) {
$possiblePaths = @(
"${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe",
"${env:ProgramFiles}\Inno Setup 6\ISCC.exe",
"${env:ProgramFiles(x86)}\Inno Setup 5\ISCC.exe"
)
$isccPath = $possiblePaths | Where-Object { Test-Path $_ } | Select-Object -First 1
if (-not $isccPath) {
Write-Warning "Inno Setup not found. Skipping installer build."
Write-Warning " Install from: https://jrsoftware.org/isdl.php"
} else {
$iscc = $isccPath
}
}
if ($iscc) {
$issFile = Join-Path $ProjectRoot "Setup.iss"
if (Test-Path $issFile) {
& $iscc $issFile
Write-Host " Installer built." -ForegroundColor Green
} else {
Write-Warning "Setup.iss not found. Skipping installer."
}
}
} else {
Write-Host "[4/5] Skipped (use -InnoSetup to build installer)" -ForegroundColor Gray
}
# ---- Step 5: Cleanup ----
Write-Host "[5/5] Cleanup..." -ForegroundColor Yellow
Remove-Item -Recurse -Force "build" -ErrorAction SilentlyContinue
Write-Host ""
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host " BUILD COMPLETE" -ForegroundColor Cyan
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host "Output: $archiveName" -ForegroundColor Green
if ($InnoSetup -and $iscc) {
Write-Host "Installer: Output\Warlock-Studio-$version-Full-Installer.exe" -ForegroundColor Green
}