Build/release
94 lines · 2824 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"
8macos_folder="$release_folder/macos"
9installer_script="Build/curd-windows-build.iss"
10
11# Ensure required directories exist
12mkdir -p "$windows_folder" "$linux_folder" "$macos_folder"
13mkdir -p "$windows_folder/bin"
14
15# Update version in the installer script
16sed -i "s/^AppVersion=.*/AppVersion=$version/" "$installer_script"
17
18# Update Source paths in the installer script
19sed -i "s|Source: \".*curd.exe\"|Source: \"Z:$windows_folder/curd.exe\"|" "$installer_script"
20# sed -i "s|Source: \".*mpv.exe\"|Source: \"Z:$windows_folder/mpv.exe\"|" "$installer_script"
21
22# Build Linux binary
23echo "Building Linux binary..."
24bash Build/buildlinux
25
26# Move the Linux binary to the release folder
27if [ -f "curd" ]; then
28 mv curd "$linux_folder/curd-linux-x86_64"
29else
30 echo "Linux build failed. Please check Build/buildlinux."
31 exit 1
32fi
33
34# Build macOS binaries
35echo "Building macOS binaries..."
36bash Build/buildmac
37if [ -f "curd" ]; then
38 mv curd "$macos_folder/curd-macos-x86_64"
39else
40 echo "macOS Intel build failed. Please check Build/buildmac."
41 exit 1
42fi
43
44bash Build/buildmac-arm64
45if [ -f "curd" ]; then
46 mv curd "$macos_folder/curd-macos-arm64"
47else
48 echo "macOS ARM build failed. Please check Build/buildmac-arm64."
49 exit 1
50fi
51
52# Create Universal binary for macOS
53echo "Creating macOS Universal binary..."
54llvm-lipo -create "$macos_folder/curd-amd64" "$macos_folder/curd-arm64" -output "$macos_folder/curd"
55rm "$macos_folder/curd-amd64" "$macos_folder/curd-arm64"
56
57# Build Windows binary
58echo "Building Windows binary..."
59bash Build/buildwindows
60
61# Uncompress mpv.exe.gz
62echo "Uncompressing mpv.exe..."
63gunzip -c Build/mpv.exe.gz > "Build/mpv.exe"
64
65# Move the Windows binary to the release folder
66if [ -f "curd.exe" ]; then
67 mv curd.exe "$windows_folder/curd-windows.exe"
68else
69 echo "Windows build failed. Please check Build/buildwindows."
70 exit 1
71fi
72
73# # Copy mpv.exe to the Windows release folder
74# if [ -f "Build/mpv.exe" ]; then
75# cp "Build/mpv.exe" "$windows_folder/"
76# else
77# echo "mpv.exe not found. Skipping copy."
78# fi
79
80# Create Windows installer with Inno Setup
81echo "Creating Windows installer..."
82wine "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "$installer_script"
83
84# Move installer to the release folder
85installer_output="Build/Output/CurdInstaller.exe" # Replace with actual output location if different
86if [ -f "$installer_output" ]; then
87 mv "$installer_output" "$windows_folder/Curd-Windows-Installer.exe"
88else
89 echo "Installer creation failed. Please check Inno Setup script output."
90fi
91
92rm "Build/mpv.exe"
93
94echo "Release build completed in $release_folder."