2022-09-18 16:34:43 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-09-25 23:08:24 +02:00
|
|
|
# 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
|
|
|
|
|
2022-09-18 16:34:43 +02:00
|
|
|
set -e -o pipefail
|
|
|
|
|
|
|
|
Suffix="$(date +"%Y-%m-%d")"
|
|
|
|
Target="release_$Suffix"
|
2022-10-31 22:28:18 +01:00
|
|
|
Image="musique-builder"
|
2022-09-18 16:34:43 +02:00
|
|
|
|
|
|
|
if [ -d "$Target" ]; then
|
|
|
|
rm -rf "$Target"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$Target"
|
|
|
|
|
2022-10-31 22:28:18 +01:00
|
|
|
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
|
|
|
|
|
2022-11-20 16:10:46 +01:00
|
|
|
cp bin/musique "$Target"/musique-x86_64-linux
|
2022-09-18 16:34:43 +02:00
|
|
|
|
2022-10-31 22:28:18 +01:00
|
|
|
sudo rm -rf bin/
|
|
|
|
make os=windows >/dev/null
|
2022-11-21 17:03:14 +01:00
|
|
|
cp bin/musique.exe "$Target"/musique-x86_64-windows.exe
|
2022-10-08 20:32:41 +02:00
|
|
|
|
2022-09-18 16:34:43 +02:00
|
|
|
cp LICENSE "$Target"/LICENSE
|
2022-09-25 23:08:24 +02:00
|
|
|
cp CHANGELOG.md "$Target/CHANGELOG.md"
|
2022-09-18 16:34:43 +02:00
|
|
|
cp -r examples "$Target"/examples
|
2022-09-18 21:40:44 +02:00
|
|
|
sed "s/bin\/musique/musique/" scripts/install > "$Target"/install.sh
|
2022-09-18 21:25:42 +02:00
|
|
|
chmod 0755 "$Target"/install.sh
|
2022-09-18 16:34:43 +02:00
|
|
|
|
|
|
|
lowdown -s doc/functions.md -m "title:Lista funkcji języka Musique" -o "$Target"/functions.html
|
2022-09-25 23:08:24 +02:00
|
|
|
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"
|
2022-11-21 17:03:14 +01:00
|
|
|
make doc/wprowadzenie.html && mv doc/wprowadzenie.html "${Target}/wprowadzenie.html"
|
2022-09-18 16:34:43 +02:00
|
|
|
|
2022-09-18 16:42:39 +02:00
|
|
|
git clone --recursive --quiet --depth=1 "$(git remote -v | awk '{ print $2 }' | head -n1)" "$Target"/source_code
|
2022-09-18 16:34:43 +02:00
|
|
|
rm -rf "$Target"/source_code/.git
|
|
|
|
|
|
|
|
zip -q -r "musique_$Suffix.zip" "$Target"/*
|