A CI base docker image for when building Nim(lang) packages for Linux (native compilation) and Windows (cross compilation).
- Based on
debian:latest
- Uses ChooseNim to install Nim and Nimble
- Contains the Windows 64bit version of Nim - This allows packaging required base-DLLs with the win64 binary. (TODO Check if they are required for running under wine only, or also on native windows?)
In your CI configuration,
choose hoijui/nim-ci
as the base (docker-)image.
Then you are able to use nim and nimble for native-compiling (Linux 64bit),
and additionally MinGW for cross-compiling (Windows 64bit).
This .gitlab-ci.yml
file compiles the software
for Linux and Windows (both 64bit).
default:
image: hoijui/nim-ci:latest
pages:
script:
- |
echo
echo "Compiling the software for Linux ..."
nimble -y build
echo
echo "Cross-compiling the software for Windows 64 ..."
nimble -y build \
--os:windows \
--cpu:amd64 \
--gcc.exe:/usr/bin/x86_64-w64-mingw32-gcc \
--gcc.linkerexe:/usr/bin/x86_64-w64-mingw32-gcc \
-d:release \
--app:console \
--opt:size \
--passL:-static \
--opt:speed \
--embedsrc \
--threads:on \
--checks:on
only:
- master
artifacts:
paths:
- public
See the .gitlab-ci.yml
of the osh-tool
for a sample project that uses nim-ci
.