CICD: Add GitHub Action to build the Windows (MXE) Builder Docker Image.

Add a GitHub action that builds the docker image to run builds for the
Windows (MXE) version of Subsurface.
Also update the MXE image Dockerfile to the latest version of MXE, and
add a patch to use a current version of mdbtools.
Configure GitHub actions that do not build docker images to not trigger
on changes to the contents of `scripts/docker/`.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2024-01-21 01:07:33 +13:00 committed by Dirk Hohndel
parent eea75fc1c4
commit c1bfded4a7
17 changed files with 186 additions and 39 deletions

View file

@ -1,9 +1,13 @@
name: Android name: Android
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master
pull_request: pull_request:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -1,6 +1,8 @@
name: Fedora Copr Build name: Fedora Copr Build
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -1,9 +1,13 @@
name: iOS name: iOS
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master
pull_request: pull_request:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -1,9 +1,13 @@
name: Fedora 35 / Qt 6-- name: Fedora 35 / Qt 6--
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master
pull_request: pull_request:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -1,9 +1,13 @@
name: Ubuntu 20.04 / Qt 5.12-- name: Ubuntu 20.04 / Qt 5.12--
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master
pull_request: pull_request:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -1,9 +1,13 @@
name: Ubuntu 22.04 / Qt 5.15-- name: Ubuntu 22.04 / Qt 5.15--
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master
pull_request: pull_request:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -2,9 +2,13 @@ name: Linux Snap
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master
pull_request: pull_request:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -1,9 +1,13 @@
name: Ubuntu 14.04 / Qt 5.12 for AppImage-- name: Ubuntu 14.04 / Qt 5.12 for AppImage--
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master
pull_request: pull_request:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -1,9 +1,13 @@
name: Mac name: Mac
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master
pull_request: pull_request:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -1,6 +1,8 @@
name: Post Release name: Post Release
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -1,6 +1,8 @@
name: Ubuntu Launchpad Build name: Ubuntu Launchpad Build
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -0,0 +1,36 @@
name: Windows (MXE) Docker Image
on:
push:
paths:
- scripts/docker/mxe-build-container/**
- .github/workflows/windows-mxe-dockerimage.yml
jobs:
windows-mxe:
runs-on: ubuntu-latest
env:
VERSION: ${{ '3.1.0' }} # 'official' images should have a dot-zero version
mxe_sha: 'c0bfefc57a00fdf6cb5278263e21a478e47b0bf5'
steps:
- uses: actions/checkout@v1
- name: Build the name for the docker image
id: build_name
run: |
v=${{ env.VERSION }}
b=${{ github.ref }} # -BRANCH suffix, unless the branch is master
b=${b/refs\/heads\//}
b=${b,,} # the name needs to be all lower case
if [ $b = "master" ] ; then b="" ; else b="-$b" ; fi
echo "NAME=${{ github.repository_owner }}/mxe-build${b}:${v}" >> $GITHUB_OUTPUT
- name: Build and Publish Linux Docker image to Dockerhub
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ steps.build_name.outputs.NAME }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
workdir: './scripts/docker/mxe-build-container/'
buildargs: mxe_sha

View file

@ -1,9 +1,13 @@
name: Windows name: Windows
on: on:
push: push:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master
pull_request: pull_request:
paths-ignore:
- scripts/docker/**
branches: branches:
- master - master

View file

@ -1,77 +1,94 @@
# Build the image using the --build-arg option, e.g.: # Build the image using the --build-arg option, e.g.:
# docker build -t boret/myimage:0.1 --build-arg=mxe_sha=123ABC456 . # docker build -t boret/myimage:0.1 --build-arg=mxe_sha=123ABC456 .
#
# Start from Ubuntu FROM ubuntu:22.04 as base
From ubuntu:22.04
# very often master is broken, so we pass in a known good SHA # update and set up the packages we need for the build
ARG mxe_sha=master RUN apt-get update && \
ENV _ver=${mxe_sha} apt-get upgrade -y && \
apt-get install -y \
# update and set up the packages we need for this cross build
RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
autoconf \ autoconf \
automake \ automake \
autopoint \ autopoint \
bash \ bash \
binutils \ binutils \
bison \
bzip2 \ bzip2 \
ca-certificates \ ca-certificates \
flex \
g++ \ g++ \
g++-multilib \ g++-multilib \
gettext \ gettext \
git \ git \
gperf \
intltool \ intltool \
libc6-dev-i386 \
libgdk-pixbuf2.0-dev \
libltdl-dev \ libltdl-dev \
libssl-dev \ libssl-dev \
libtool \ libtool \
libtool-bin \ libtool-bin \
libxml-parser-perl \
make \ make \
openssl \ openssl \
p7zip-full \ p7zip-full \
patch \ patch \
perl \ perl \
pkg-config \ pkg-config \
python3 \
python3-mako \
ruby \
sed \ sed \
unzip \ unzip \
wget \ wget \
lzip && \
apt-get clean
FROM base as build
# set up the packages we need additionally for this cross build
RUN apt-get install -y \
bison \
flex \
gperf \
libc6-dev-i386 \
libgdk-pixbuf2.0-dev \
libxml-parser-perl \
python3 \
python3-mako \
python-is-python3 \
ruby \
xz-utils \ xz-utils \
lzip \
scons scons
# very often master is broken, so we pass in a known good SHA
ARG mxe_sha=master
ENV _ver=${mxe_sha}
WORKDIR /win
# checkout MXE at the right version # checkout MXE at the right version
RUN mkdir -p /win RUN git clone https://github.com/mxe/mxe && \
RUN cd /win ; git clone https://github.com/mxe/mxe ; \ cd mxe && \
cd mxe ; \ git checkout ${_ver}
git checkout ${_ver} ;
WORKDIR /win/mxe
# Move the settings into place to build everything that we need
ADD settings.mk .
# Patch the qtconnectivity build to explicilty enable native-win32-bluetooth and ensure another # Patch the qtconnectivity build to explicilty enable native-win32-bluetooth and ensure another
# backend is not picked # backend is not picked
ADD qtconnectivity-1.patch /win/mxe/src/qtconnectivity-1.patch ADD qtconnectivity-1.patch src/
ADD mdbtools_version.patch .
RUN patch -p1 < mdbtools_version.patch 2>&1 | tee mxe-patch.log
# Move the settings into place to build everything that we need
# separate download from build so that we can redo the build # separate download from build so that we can redo the build
ADD settings.mk /win/mxe/settings.mk RUN make -j download 2>&1 | tee mxe-build.log
RUN cd /usr/bin ; ln -s -f python3 python
RUN cd /win/mxe ; \ RUN make -j 2>&1 | tee -a mxe-build.log
make -j 6 download 2>&1 | tee mxe-build.log
RUN cd /win/mxe ; \
make -j 6 2>&1 | tee -a mxe-build.log ;
# for some reason smtk2ssrf needs a static build of mdbtools # for some reason smtk2ssrf needs a static build of mdbtools
RUN cd /win/mxe ; \ RUN make MXE_TARGETS=x86_64-w64-mingw32.static glib mdbtools -j 2>&1 | tee -a mxe-build.log
make MXE_TARGETS=x86_64-w64-mingw32.static glib mdbtools -j 6 2>&1 | tee -a mxe-build.log ;
RUN apt-get remove -y bison flex gperf libc6-dev-i386 libgdk-pixbuf2.0-dev libxml-parser-perl python ruby xz-utils scons && rm -rf /var/lib/apt/lists/* RUN rm -rf pkg log docs
RUN rm -rf /win/mxe/pkg /win/mxe/log /win/mxe/docs
FROM base as final
WORKDIR /win
COPY --from=build /win/mxe mxe

2
scripts/docker/mxe-build-container/build-container.sh Normal file → Executable file
View file

@ -3,7 +3,7 @@ set -x
set -e set -e
# known good MXE sha # known good MXE sha
MXE_SHA="0d21cf2e31d4e6c0" MXE_SHA="c0bfefc57a00fdf6cb5278263e21a478e47b0bf5"
SCRIPTPATH=$(dirname $0) SCRIPTPATH=$(dirname $0)
# version of the docker image # version of the docker image

View file

@ -0,0 +1,52 @@
# Temporary patch to apply to MXE's src/mdbtools.mk file while building docker
# image, until it's applied upstream at github's MXE repo.
diff --git a/src/mdbtools.mk b/src/mdbtools.mk
index 42d303c2..d9d0f557 100644
--- a/src/mdbtools.mk
+++ b/src/mdbtools.mk
@@ -1,19 +1,17 @@
# This file is part of MXE. See LICENSE.md for licensing information.
PKG := mdbtools
-$(PKG)_WEBSITE := https://sourceforge.net/projects/mdbtools/
+$(PKG)_WEBSITE := https://github.com/mdbtools/mdbtools
$(PKG)_IGNORE :=
-$(PKG)_VERSION := 0.7.1
-$(PKG)_CHECKSUM := 4eac1bce55066a38d9ea6c52a8e8ecc101b79afe75118ecc16852990472c4721
-$(PKG)_SUBDIR := brianb-mdbtools-f8ce1cc
-$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
-$(PKG)_URL := https://github.com/brianb/$(PKG)/tarball/$($(PKG)_VERSION)/$($(PKG)_FILE)
+$(PKG)_VERSION := 1.0.0
+$(PKG)_CHECKSUM := 3446e1d71abdeb98d41e252777e67e1909b186496fda59f98f67032f7fbcd955
+$(PKG)_GH_CONF := mdbtools/mdbtools/releases, v
$(PKG)_DEPS := cc glib
define $(PKG)_UPDATE
- $(WGET) -q -O- 'https://github.com/brianb/mdbtools/tags' | \
- grep '<a href="/brianb/mdbtools/archive/' | \
- $(SED) -n 's,.*href="/brianb/mdbtools/archive/\([0-9][^"_]*\)\.tar.*,\1,p' | \
+ $(WGET) -q -O- 'https://github.com/mdbtools/mdbtools/tags' | \
+ grep 'href="/mdbtools/mdbtools/archive/' | \
+ $(SED) -n 's,.*href="/mdbtools/mdbtools/archive/refs/tags/v\([0-9][^"_]*\)\.tar.*,\1,p' | \
head -1
endef
@@ -24,10 +22,11 @@ define $(PKG)_BUILD
--build="`config.guess`" \
--disable-shared \
--disable-man \
+ --without-bash-completion-dir \
--prefix='$(PREFIX)/$(TARGET)' \
PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config'
- $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= html_DATA= || \
- $(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= html_DATA=
+ $(MAKE) CFLAGS+='-Wno-deprecated-declarations' -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= html_DATA= || \
+ $(MAKE) CFLAGS+='-Wno-deprecated-declarations' -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= html_DATA=
endef
$(PKG)_BUILD_SHARED =
--
2.43.0

View file

@ -3,10 +3,10 @@
# This variable controls the number of compilation processes # This variable controls the number of compilation processes
# within one package ("intra-package parallelism"). # within one package ("intra-package parallelism").
JOBS := 8 #JOBS := 8
# This variable controls the targets that will build. # This variable controls the targets that will build.
MXE_TARGETS := x86_64-w64-mingw32.shared i686-w64-mingw32.shared MXE_TARGETS := x86_64-w64-mingw32.shared
# MXE_PLUGIN_DIRS := plugins/gcc10 # MXE_PLUGIN_DIRS := plugins/gcc10