Build/release

68 lines · 2056 bytes · executable

 1#!/bin/bash
 2
 3# Ask for version number
 4read -p "Enter the version number: " version
 5release_folder="releases/curd-$version"
 6windows_folder="$release_folder/windows"
 7linux_folder="$release_folder/linux"
 8installer_script="Build/curd-windows-build.iss"
 9
10# Ensure required directories exist
11mkdir -p "$windows_folder" "$linux_folder"
12mkdir -p "$windows_folder/bin"
13
14# Uncompress mpv.exe.gz
15echo "Uncompressing mpv.exe..."
16gunzip -c Build/mpv.exe.gz > "Build/mpv.exe"
17
18# Update version in the installer script
19sed -i "s/^AppVersion=.*/AppVersion=$version/" "$installer_script"
20
21# Update Source paths in the installer script
22sed -i "s|Source: \".*curd.exe\"|Source: \"Z:$windows_folder/curd.exe\"|" "$installer_script"
23# sed -i "s|Source: \".*mpv.exe\"|Source: \"Z:$windows_folder/mpv.exe\"|" "$installer_script"
24
25# Build Linux binary
26echo "Building Linux binary..."
27bash Build/buildlinux
28
29# Move the Linux binary to the release folder
30if [ -f "curd" ]; then
31    mv curd "$linux_folder/"
32else
33    echo "Linux build failed. Please check Build/buildlinux."
34    exit 1
35fi
36
37# Build Windows binary
38echo "Building Windows binary..."
39bash Build/buildwindows
40
41# Move the Windows binary to the release folder
42if [ -f "curd.exe" ]; then
43    mv curd.exe "$windows_folder/"
44else
45    echo "Windows build failed. Please check Build/buildwindows."
46    exit 1
47fi
48
49# # Copy mpv.exe to the Windows release folder
50# if [ -f "Build/mpv.exe" ]; then
51#     cp "Build/mpv.exe" "$windows_folder/"
52# else
53#     echo "mpv.exe not found. Skipping copy."
54# fi
55
56# Create Windows installer with Inno Setup
57echo "Creating Windows installer..."
58wine "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "$installer_script"
59
60# Move installer to the release folder
61installer_output="Build/Output/CurdInstaller.exe"  # Replace with actual output location if different
62if [ -f "$installer_output" ]; then
63    mv "$installer_output" "$windows_folder/CurdInstaller.exe"
64else
65    echo "Installer creation failed. Please check Inno Setup script output."
66fi
67
68echo "Release build completed in $release_folder."