From 7aecf2ea198cfeb33ccab6b27bd42986a9b903f4 Mon Sep 17 00:00:00 2001 From: Robert Bendun Date: Mon, 31 Oct 2022 22:28:18 +0100 Subject: [PATCH] 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 --- Dockerfile | 8 ++++++++ scripts/release | 18 +++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..92706bd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM ubuntu:20.04 + +ARG TZ=Europe/Warsaw +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt update && apt upgrade -y && apt install -y build-essential software-properties-common zip unzip +RUN add-apt-repository ppa:ubuntu-toolchain-r/test +RUN apt install -y gcc-11 g++-11 libasound2-dev diff --git a/scripts/release b/scripts/release index b24970b..cbb494b 100755 --- a/scripts/release +++ b/scripts/release @@ -8,7 +8,7 @@ set -e -o pipefail Suffix="$(date +"%Y-%m-%d")" Target="release_$Suffix" - +Image="musique-builder" if [ -d "$Target" ]; then rm -rf "$Target" @@ -16,14 +16,18 @@ fi mkdir -p "$Target" -make clean && make os=linux +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"/ -make clean && make os=windows +sudo rm -rf bin/ +make os=windows >/dev/null cp bin/musique.exe "$Target"/ -echo "Copy examples, license and documentation" - cp LICENSE "$Target"/LICENSE cp CHANGELOG.md "$Target/CHANGELOG.md" cp -r examples "$Target"/examples @@ -34,11 +38,7 @@ lowdown -s doc/functions.md -m "title:Lista funkcji języka Musique" -o "$Target 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" -echo "Copy source code" - git clone --recursive --quiet --depth=1 "$(git remote -v | awk '{ print $2 }' | head -n1)" "$Target"/source_code rm -rf "$Target"/source_code/.git -echo "Boundle it all up" - zip -q -r "musique_$Suffix.zip" "$Target"/*