Dockerfile builds Windows and Linux releases

This commit is contained in:
Robert Bendun 2023-01-15 00:37:11 +01:00
parent 243c49234f
commit 9f57bbaecd
6 changed files with 50 additions and 8 deletions

View File

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Introduced start synchronization with builtins: `peers` and `start` - Introduced start synchronization with builtins: `peers` and `start`
- Connection with MIDI ports via parameters dropped in favour of function using context system: `port` - Connection with MIDI ports via parameters dropped in favour of function using context system: `port`
- Listing ports via REPL command: `:ports` instead of commandline parameter - Listing ports via REPL command: `:ports` instead of commandline parameter
- Building release with `make musique.zip` using Docker
### Changed ### Changed
@ -23,7 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ### Removed
- Release builder, since it's separate part of the project - Release script builder
### Fixed ### Fixed

View File

@ -1,8 +1,41 @@
FROM ubuntu:20.04 FROM ubuntu:20.04 AS linux
ARG TZ=Europe/Warsaw ARG TZ=Europe/Warsaw
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update && apt install -y make software-properties-common zip unzip git
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 add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt install -y gcc-11 g++-11 libasound2-dev RUN apt install -y gcc-11 g++-11 libasound2-dev
RUN mkdir -p /src/
WORKDIR /src/
COPY config.mk Makefile /src/
COPY .git /src/.git/
COPY musique /src/musique/
COPY lib /src/lib/
COPY scripts /src/scripts/
RUN make clean && make CC=gcc-11 CXX=g++-11
FROM ubuntu:22.04 AS windows
RUN apt update && apt install -y git make gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64
RUN mkdir -p /src/
WORKDIR /src/
COPY config.mk Makefile /src/
COPY .git /src/.git/
COPY musique /src/musique/
COPY lib /src/lib/
COPY scripts /src/scripts/
RUN make clean && make os=windows CC=x86_64-w64-mingw32-gcc-posix CXX=x86_64-w64-mingw32-g++-posix
FROM ubuntu:22.04 AS release
RUN apt update && apt install -y zip pandoc python3 python-is-python3 pandoc
COPY CHANGELOG.md LICENSE /musique/
COPY examples /musique/examples/
COPY --from=windows /src/bin/musique.exe /musique/musique-windows.exe
COPY --from=linux /src/bin/musique /musique/musique-linux
COPY doc /doc/
COPY scripts /scripts/
RUN python /scripts/language-cmp-cheatsheet.py /doc/musique-vs-languages-cheatsheet.template \
&& bash -c 'cp /{doc,musique}/musique-vs-languages-cheatsheet.html'
RUN pandoc -o /musique/wprowadzenie.html /doc/wprowadzenie.md -s --toc
RUN zip -r musique.zip /musique/

View File

@ -47,6 +47,12 @@ doc/wprowadzenie.html: doc/wprowadzenie.md
doc/functions.html: musique/interpreter/builtin_functions.cc scripts/document-builtin.py doc/functions.html: musique/interpreter/builtin_functions.cc scripts/document-builtin.py
scripts/document-builtin.py -o $@ $< scripts/document-builtin.py -o $@ $<
musique.zip: doc/* $(Sources) scripts/*
docker build -t musique-builder .
docker create --name musique musique-builder
docker cp musique:/musique.zip musique.zip
docker rm -f musique
.PHONY: clean doc doc-open all test unit-tests release install .PHONY: clean doc doc-open all test unit-tests release install
$(shell mkdir -p $(subst musique/,bin/$(os)/,$(shell find musique/* -type d))) $(shell mkdir -p $(subst musique/,bin/$(os)/,$(shell find musique/* -type d)))

View File

@ -1,5 +1,7 @@
# Musique interpreter # Musique interpreter
Reference implementation of Musique programming language.
## Building ## Building
Reference [`build_instructions.md`](./build_instructions.md). Reference [`build_instructions.md`](./build_instructions.md).

View File

@ -2,7 +2,7 @@
## Linux ## Linux
Consult README.md. Use your local C++ compiler (supporting C++20) and ALSA dev libraries or included Dockerfile.
## MacOS ## MacOS
@ -23,5 +23,5 @@ Windows support is provided via cross compilation. Mingw GCC C++ compiler is req
$ make os=windows $ make os=windows
``` ```
will create `bin/musique.exe` that can be used on x86_64 Windows operating systems. will create `bin/musique.exe` that can be used on x86_64 Windows operating systems or use included Dockerfile

View File

@ -6,7 +6,7 @@ PATCH := 1
COMMIT := gc$(shell git rev-parse --short HEAD 2>/dev/null) COMMIT := gc$(shell git rev-parse --short HEAD 2>/dev/null)
ifeq ($(COMMIT),gc) ifeq ($(COMMIT),gc)
COMMIT = "gcunknown" COMMIT = gcunknown
endif endif
VERSION := $(MAJOR).$(MINOR).$(PATCH)-dev+$(COMMIT) VERSION := $(MAJOR).$(MINOR).$(PATCH)-dev+$(COMMIT)