norgbackup/scripts/build.sh

41 lines
961 B
Bash
Raw Normal View History

2024-11-25 13:28:22 +01:00
#!/usr/bin/env sh
version=$(grep -i version norg.nimble | awk '{print $3}' | sed "s/\"//g" | sed "s/\./_/g")
dir=$(pwd)
echo Building for Linux
2025-01-02 18:32:03 +01:00
for cpu in amd64; do
nimble build -d:linux --cpu:$cpu
if [ $? != 1 ]; then
echo "Compressing..."
cd bin || exit
tar cvzf "norg_linux_$cpu-$version.tar.gz" norg
rm norg
cd "$dir" || exit
echo Done.
fi
echo Building for FreeBSD
nimble build -d:freebsd --cpu:$cpu
if [ $? != 1 ]; then
echo "Compressing..."
cd bin || exit
tar cvzf "norg_freebsd_$cpu-$version.tar.gz" norg
rm norg
cd "$dir" || exit
echo Done.
fi
echo Building for Windows
nimble build -d:mingw --cpu:$cpu
if [ $? != 1 ]; then
echo "Zipping..."
cd bin || exit
cp ../resources/windows/lib* ./
zip "norg_windows_$cpu-$version.zip" norg.exe lib*
rm ./lib*
cd "$dir" || exit
rm bin/norg.exe
echo Done.
fi
done