2019-10-16 11:31:29 -07:00
|
|
|
#!/bin/bash
|
|
|
|
# this gets executed inside the container when building a Windows
|
2023-12-06 13:20:20 -08:00
|
|
|
# installer as GitHub Action
|
2019-10-16 11:31:29 -07:00
|
|
|
#
|
|
|
|
# working directory is assumed to be the directory including all the
|
|
|
|
# source directories (subsurface, googlemaps, grantlee, etc)
|
|
|
|
# in order to be compatible with the assumed layout in the MXE script, we
|
|
|
|
# need to create the secondary build directory
|
|
|
|
|
|
|
|
set -x
|
|
|
|
set -e
|
|
|
|
|
|
|
|
mkdir -p win32
|
|
|
|
cd win32
|
|
|
|
|
2024-11-23 10:31:16 +13:00
|
|
|
BUILD_EXTRA_ARGS="debug"
|
|
|
|
SMTK2SSRF_EXTRA_ARGS="-b debug"
|
|
|
|
if [[ "$1" == "-release" ]]; then
|
|
|
|
BUILD_EXTRA_ARGS=""
|
|
|
|
SMTK2SSRF_BUILD_EXTRA_ARGS="-b release"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2024-09-30 22:53:49 +13:00
|
|
|
# build Subsurface
|
2020-10-29 13:03:56 -07:00
|
|
|
export MXEBUILDTYPE=x86_64-w64-mingw32.shared
|
2024-11-23 10:31:16 +13:00
|
|
|
bash -ex ../subsurface/packaging/windows/mxe-based-build.sh ${BUILD_EXTRA_ARGS} installer
|
2019-10-16 11:31:29 -07:00
|
|
|
|
|
|
|
# the strange two step move is in order to get predictable names to use
|
|
|
|
# in the publish step of the GitHub Action
|
2024-04-24 11:27:10 +12:00
|
|
|
mv subsurface/subsurface.exe* ${OUTPUT_DIR}/
|
2023-12-07 02:38:00 -08:00
|
|
|
fullname=$(cd subsurface ; ls subsurface-*.exe)
|
2024-04-24 11:27:10 +12:00
|
|
|
mv subsurface/"$fullname" ${OUTPUT_DIR}/"${fullname%.exe}-installer.exe"
|
2019-10-16 11:31:29 -07:00
|
|
|
|
2024-09-30 22:53:49 +13:00
|
|
|
# build Subsurface for smtk2ssrf
|
|
|
|
|
|
|
|
bash -ex ../subsurface/packaging/windows/mxe-based-build.sh -noftdi -nolibraw subsurface
|
|
|
|
|
2024-11-23 10:31:16 +13:00
|
|
|
bash -ex ../subsurface/packaging/windows/smtk2ssrf-mxe-build.sh ${SMTK2SSRF_BUILD_EXTRA_ARGS} -a -i
|
2019-10-16 11:31:29 -07:00
|
|
|
|
|
|
|
# the strange two step move is in order to get predictable names to use
|
|
|
|
# in the publish step of the GitHub Action
|
2024-04-24 11:27:10 +12:00
|
|
|
mv smtk-import/smtk2ssrf.exe ${OUTPUT_DIR}/
|
2023-12-07 02:38:00 -08:00
|
|
|
fullname=$(cd smtk-import ; ls smtk2ssrf*.exe)
|
2024-04-24 11:27:10 +12:00
|
|
|
mv smtk-import/smtk2ssrf*.exe ${OUTPUT_DIR}/"${fullname%.exe}-installer.exe"
|