mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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:
parent
eea75fc1c4
commit
c1bfded4a7
17 changed files with 186 additions and 39 deletions
4
.github/workflows/android.yml
vendored
4
.github/workflows/android.yml
vendored
|
@ -1,9 +1,13 @@
|
|||
name: Android
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
2
.github/workflows/fedora-copr-build.yml
vendored
2
.github/workflows/fedora-copr-build.yml
vendored
|
@ -1,6 +1,8 @@
|
|||
name: Fedora Copr Build
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
4
.github/workflows/ios.yml
vendored
4
.github/workflows/ios.yml
vendored
|
@ -1,9 +1,13 @@
|
|||
name: iOS
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
4
.github/workflows/linux-fedora-qt6.yml
vendored
4
.github/workflows/linux-fedora-qt6.yml
vendored
|
@ -1,9 +1,13 @@
|
|||
name: Fedora 35 / Qt 6--
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
4
.github/workflows/linux-focal-5.12.yml
vendored
4
.github/workflows/linux-focal-5.12.yml
vendored
|
@ -1,9 +1,13 @@
|
|||
name: Ubuntu 20.04 / Qt 5.12--
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
4
.github/workflows/linux-jammy-5.15.yml
vendored
4
.github/workflows/linux-jammy-5.15.yml
vendored
|
@ -1,9 +1,13 @@
|
|||
name: Ubuntu 22.04 / Qt 5.15--
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
4
.github/workflows/linux-snap.yml
vendored
4
.github/workflows/linux-snap.yml
vendored
|
@ -2,9 +2,13 @@ name: Linux Snap
|
|||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
4
.github/workflows/linux-trusty-5.12.yml
vendored
4
.github/workflows/linux-trusty-5.12.yml
vendored
|
@ -1,9 +1,13 @@
|
|||
name: Ubuntu 14.04 / Qt 5.12 for AppImage--
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
4
.github/workflows/mac.yml
vendored
4
.github/workflows/mac.yml
vendored
|
@ -1,9 +1,13 @@
|
|||
name: Mac
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
2
.github/workflows/post-releasenotes.yml
vendored
2
.github/workflows/post-releasenotes.yml
vendored
|
@ -1,6 +1,8 @@
|
|||
name: Post Release
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
2
.github/workflows/ubuntu-launchpad-build.yml
vendored
2
.github/workflows/ubuntu-launchpad-build.yml
vendored
|
@ -1,6 +1,8 @@
|
|||
name: Ubuntu Launchpad Build
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
36
.github/workflows/windows-mxe-dockerimage.yml
vendored
Normal file
36
.github/workflows/windows-mxe-dockerimage.yml
vendored
Normal 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
|
4
.github/workflows/windows.yml
vendored
4
.github/workflows/windows.yml
vendored
|
@ -1,9 +1,13 @@
|
|||
name: Windows
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- scripts/docker/**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
|
|
@ -1,77 +1,94 @@
|
|||
# Build the image using the --build-arg option, e.g.:
|
||||
# docker build -t boret/myimage:0.1 --build-arg=mxe_sha=123ABC456 .
|
||||
#
|
||||
|
||||
# Start from Ubuntu
|
||||
From ubuntu:22.04
|
||||
FROM ubuntu:22.04 as base
|
||||
|
||||
# very often master is broken, so we pass in a known good SHA
|
||||
ARG mxe_sha=master
|
||||
ENV _ver=${mxe_sha}
|
||||
|
||||
# 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 \
|
||||
# update and set up the packages we need for the build
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y \
|
||||
autoconf \
|
||||
automake \
|
||||
autopoint \
|
||||
bash \
|
||||
binutils \
|
||||
bison \
|
||||
bzip2 \
|
||||
ca-certificates \
|
||||
flex \
|
||||
g++ \
|
||||
g++-multilib \
|
||||
gettext \
|
||||
git \
|
||||
gperf \
|
||||
intltool \
|
||||
libc6-dev-i386 \
|
||||
libgdk-pixbuf2.0-dev \
|
||||
libltdl-dev \
|
||||
libssl-dev \
|
||||
libtool \
|
||||
libtool-bin \
|
||||
libxml-parser-perl \
|
||||
make \
|
||||
openssl \
|
||||
p7zip-full \
|
||||
patch \
|
||||
perl \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-mako \
|
||||
ruby \
|
||||
sed \
|
||||
unzip \
|
||||
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 \
|
||||
lzip \
|
||||
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
|
||||
RUN mkdir -p /win
|
||||
RUN cd /win ; git clone https://github.com/mxe/mxe ; \
|
||||
cd mxe ; \
|
||||
git checkout ${_ver} ;
|
||||
RUN git clone https://github.com/mxe/mxe && \
|
||||
cd mxe && \
|
||||
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
|
||||
# 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
|
||||
ADD settings.mk /win/mxe/settings.mk
|
||||
RUN cd /usr/bin ; ln -s -f python3 python
|
||||
RUN cd /win/mxe ; \
|
||||
make -j 6 download 2>&1 | tee mxe-build.log
|
||||
RUN cd /win/mxe ; \
|
||||
make -j 6 2>&1 | tee -a mxe-build.log ;
|
||||
RUN make -j download 2>&1 | tee mxe-build.log
|
||||
|
||||
RUN make -j 2>&1 | tee -a mxe-build.log
|
||||
|
||||
# for some reason smtk2ssrf needs a static build of mdbtools
|
||||
RUN cd /win/mxe ; \
|
||||
make MXE_TARGETS=x86_64-w64-mingw32.static glib mdbtools -j 6 2>&1 | tee -a mxe-build.log ;
|
||||
RUN make MXE_TARGETS=x86_64-w64-mingw32.static glib mdbtools -j 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 /win/mxe/pkg /win/mxe/log /win/mxe/docs
|
||||
RUN rm -rf pkg log 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
2
scripts/docker/mxe-build-container/build-container.sh
Normal file → Executable file
|
@ -3,7 +3,7 @@ set -x
|
|||
set -e
|
||||
|
||||
# known good MXE sha
|
||||
MXE_SHA="0d21cf2e31d4e6c0"
|
||||
MXE_SHA="c0bfefc57a00fdf6cb5278263e21a478e47b0bf5"
|
||||
SCRIPTPATH=$(dirname $0)
|
||||
|
||||
# version of the docker image
|
||||
|
|
52
scripts/docker/mxe-build-container/mdbtools_version.patch
Normal file
52
scripts/docker/mxe-build-container/mdbtools_version.patch
Normal 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
|
||||
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
# This variable controls the number of compilation processes
|
||||
# within one package ("intra-package parallelism").
|
||||
JOBS := 8
|
||||
#JOBS := 8
|
||||
|
||||
# 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
|
||||
|
||||
|
|
Loading…
Reference in a new issue