Build/release
92 lines · 2744 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# Uncompress mpv.exe.gz
16echo "Uncompressing mpv.exe..."
17gunzip -c Build/mpv.exe.gz > "Build/mpv.exe"
18
19# Update version in the installer script
20sed -i "s/^AppVersion=.*/AppVersion=$version/" "$installer_script"
21
22# Update Source paths in the installer script
23sed -i "s|Source: \".*curd.exe\"|Source: \"Z:$windows_folder/curd.exe\"|" "$installer_script"
24# sed -i "s|Source: \".*mpv.exe\"|Source: \"Z:$windows_folder/mpv.exe\"|" "$installer_script"
25
26# Build Linux binary
27echo "Building Linux binary..."
28bash Build/buildlinux
29
30# Move the Linux binary to the release folder
31if [ -f "curd" ]; then
32 mv curd "$linux_folder/"
33else
34 echo "Linux build failed. Please check Build/buildlinux."
35 exit 1
36fi
37
38# Build macOS binaries
39echo "Building macOS binaries..."
40bash Build/buildmac
41if [ -f "curd" ]; then
42 mv curd "$macos_folder/curd-amd64"
43else
44 echo "macOS Intel build failed. Please check Build/buildmac."
45 exit 1
46fi
47
48bash Build/buildmac-arm64
49if [ -f "curd" ]; then
50 mv curd "$macos_folder/curd-arm64"
51else
52 echo "macOS ARM build failed. Please check Build/buildmac-arm64."
53 exit 1
54fi
55
56# Create Universal binary for macOS
57echo "Creating macOS Universal binary..."
58lipo -create "$macos_folder/curd-amd64" "$macos_folder/curd-arm64" -output "$macos_folder/curd"
59rm "$macos_folder/curd-amd64" "$macos_folder/curd-arm64"
60
61# Build Windows binary
62echo "Building Windows binary..."
63bash Build/buildwindows
64
65# Move the Windows binary to the release folder
66if [ -f "curd.exe" ]; then
67 mv curd.exe "$windows_folder/"
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/CurdInstaller.exe"
88else
89 echo "Installer creation failed. Please check Inno Setup script output."
90fi
91
92echo "Release build completed in $release_folder."