musique/scripts/release
Robert Bendun 7aecf2ea19 Release build system partially moved to Docker
Change to Docker forced by need of supporting older Ubuntu releases with
older glibc without building them on host
2022-10-31 22:28:18 +01:00

45 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# This script creates a release of Musique programming language
# Release is defined as a zip archive containing source code,
# build binaries for supported platforms and build documentation
set -e -o pipefail
Suffix="$(date +"%Y-%m-%d")"
Target="release_$Suffix"
Image="musique-builder"
if [ -d "$Target" ]; then
rm -rf "$Target"
fi
mkdir -p "$Target"
if [[ "$(docker images -q "$Image")" == "" ]]; then
docker build -t "$Image" .
fi
sudo rm -rf bin/
docker run -it --rm -v "$(pwd):/musique" -w /musique "$Image" make os=linux CC=gcc-11 CXX=g++-11 >/dev/null
cp bin/musique "$Target"/
sudo rm -rf bin/
make os=windows >/dev/null
cp bin/musique.exe "$Target"/
cp LICENSE "$Target"/LICENSE
cp CHANGELOG.md "$Target/CHANGELOG.md"
cp -r examples "$Target"/examples
sed "s/bin\/musique/musique/" scripts/install > "$Target"/install.sh
chmod 0755 "$Target"/install.sh
lowdown -s doc/functions.md -m "title:Lista funkcji języka Musique" -o "$Target"/functions.html
python scripts/language-cmp-cheatsheet.py doc/musique-vs-languages-cheatsheet.template
mv doc/musique-vs-languages-cheatsheet.html "${Target}/musique-vs-others-cheatsheet.html"
git clone --recursive --quiet --depth=1 "$(git remote -v | awk '{ print $2 }' | head -n1)" "$Target"/source_code
rm -rf "$Target"/source_code/.git
zip -q -r "musique_$Suffix.zip" "$Target"/*