mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Build a macOS DMG in a GitHub Action
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e26dd30165
commit
2ffba35d45
3 changed files with 39 additions and 60 deletions
61
.github/workflows/mac.yml
vendored
61
.github/workflows/mac.yml
vendored
|
@ -9,68 +9,51 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
buildMac:
|
buildMac:
|
||||||
runs-on: macOS-latest
|
runs-on: macOS-11
|
||||||
steps:
|
steps:
|
||||||
- name: checkout sources
|
- name: checkout sources
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
- name: setup Homebrew
|
- name: setup Homebrew
|
||||||
run: brew install autoconf automake libtool xz hidapi libusb libxml2 libxslt libzip openssl pkg-config libgit2 libssh2 libjpg libpng libmtp
|
run: brew install autoconf automake libtool xz hidapi libusb libxml2 libxslt libzip openssl pkg-config libgit2 libssh2 libjpg libpng libmtp create-dmg
|
||||||
- name: set our Qt build
|
- name: set our Qt build
|
||||||
run: |
|
run: |
|
||||||
mkdir -p Qt/5.13.0
|
curl --output ssrf-Qt-5.15.2-mac.tar.xz https://f002.backblazeb2.com/file/Subsurface-Travis/ssrf-Qt5.15.2.tar.xz
|
||||||
curl --output Qt-5.13.0-mac.tar.xz https://f002.backblazeb2.com/file/Subsurface-Travis/Qt-5.13.0-mac.tar.xz
|
tar -xJf ssrf-Qt-5.15.2-mac.tar.xz
|
||||||
tar -xJ -C Qt/5.13.0 -f Qt-5.13.0-mac.tar.xz
|
|
||||||
- name: build Subsurface-mobile
|
|
||||||
env:
|
|
||||||
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
|
|
||||||
run: |
|
|
||||||
cd ${GITHUB_WORKSPACE}/..
|
|
||||||
export QT_ROOT=${GITHUB_WORKSPACE}/Qt/5.13.0/clang_64
|
|
||||||
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
|
|
||||||
export PATH=$QT_ROOT/bin:$PATH
|
|
||||||
export CMAKE_PREFIX_PATH=$QT_ROOT/lib/cmake
|
|
||||||
DIR=$(pwd)
|
|
||||||
git config --global user.email "ci@subsurface-divelog.org"
|
|
||||||
git config --global user.name "Subsurface CI"
|
|
||||||
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
|
|
||||||
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
|
|
||||||
# first build Subsurface-mobile to ensure this didn't get broken
|
|
||||||
bash -e -x ./subsurface/scripts/build.sh -mobile
|
|
||||||
|
|
||||||
- name: test mobile build
|
|
||||||
run: |
|
|
||||||
echo "------------------------------------"
|
|
||||||
echo "run tests for mobile build"
|
|
||||||
export QT_ROOT=${GITHUB_WORKSPACE}/Qt/5.13.0/clang_64
|
|
||||||
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
|
|
||||||
cd ${GITHUB_WORKSPACE}/build-mobile/tests
|
|
||||||
# ./TestGitStorage -v2
|
|
||||||
make check
|
|
||||||
|
|
||||||
- name: build Subsurface
|
- name: build Subsurface
|
||||||
run: |
|
run: |
|
||||||
cd ${GITHUB_WORKSPACE}/..
|
cd ${GITHUB_WORKSPACE}/..
|
||||||
export QT_ROOT=${GITHUB_WORKSPACE}/Qt/5.13.0/clang_64
|
export QT_ROOT=${GITHUB_WORKSPACE}/Qt5.15.2/5.15.2/clang_64
|
||||||
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
|
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
|
||||||
export PATH=$QT_ROOT/bin:$PATH
|
export PATH=$QT_ROOT/bin:$PATH
|
||||||
export CMAKE_PREFIX_PATH=$QT_ROOT/lib/cmake
|
export CMAKE_PREFIX_PATH=$QT_ROOT/lib/cmake
|
||||||
DIR=$(pwd)
|
DIR=$(pwd)
|
||||||
|
|
||||||
# now Subsurface with WebKit
|
# now build Subsurface with WebKit, using the generic build script
|
||||||
bash -e -x ./subsurface/scripts/build.sh -desktop -build-with-webkit -release
|
bash -e -x ./subsurface/scripts/build.sh -desktop -build-with-webkit -release -build-deps -ftdi
|
||||||
|
|
||||||
cd ${GITHUB_WORKSPACE}/build
|
echo "finished initial build of Subsurface"
|
||||||
|
|
||||||
# build export-html to make sure that didn't get broken
|
# make sure we have FTDI enabled for the package
|
||||||
make export-html
|
cd subsurface/build
|
||||||
|
FTDI=$(grep FTDISUPPORT:BOOL CMakeCache.txt | grep ON)
|
||||||
|
if [ "$FTDI" != "FTDISUPPORT:BOOL=ON" ] ; then
|
||||||
|
cmake -D FTDISUPPORT:BOOL=ON .
|
||||||
|
fi
|
||||||
|
echo "run the packaging script"
|
||||||
|
bash -e -x ../packaging/macos/make-package.sh
|
||||||
|
IMG=$(grep ^created: ../trigger-daily.log | tail -1 | cut -b10-)
|
||||||
|
echo "Created $IMG"
|
||||||
|
|
||||||
- name: test desktop build
|
- name: test desktop build
|
||||||
run: |
|
run: |
|
||||||
|
# build export-html to make sure that didn't get broken
|
||||||
|
cd ${GITHUB_WORKSPACE}/build
|
||||||
|
make export-html
|
||||||
echo "------------------------------------"
|
echo "------------------------------------"
|
||||||
echo "run tests for desktop build"
|
echo "run tests for desktop build"
|
||||||
export QT_ROOT=${GITHUB_WORKSPACE}/Qt/5.13.0/clang_64
|
export QT_ROOT=${GITHUB_WORKSPACE}/Qt/5.13.0/clang_64
|
||||||
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
|
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
|
||||||
cd ${GITHUB_WORKSPACE}/build/tests
|
cd tests
|
||||||
# ./TestGitStorage -v2
|
# ./TestGitStorage -v2
|
||||||
make check
|
make check
|
||||||
|
|
||||||
|
|
|
@ -7,17 +7,7 @@
|
||||||
# find the directory above the sources - typically ~/src
|
# find the directory above the sources - typically ~/src
|
||||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../.. && pwd )
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../.. && pwd )
|
||||||
|
|
||||||
# install location of create-dmg
|
DMGCREATE=create-dmg
|
||||||
# by default we assume it's next to subsurface in ~/src/yoursway-create-dmg
|
|
||||||
DMGCREATE=${DIR}/yoursway-create-dmg/create-dmg
|
|
||||||
if [ ! -x $DMGCREATE ] ; then
|
|
||||||
# well, this app changed its github name, so it may be in a different directory now
|
|
||||||
DMGCREATE=${DIR}/create-dmg/create-dmg
|
|
||||||
if [ ! -x $DMGCREATE ] ; then
|
|
||||||
echo "Can't find working create-dmg, aborting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# same git version magic as in the Makefile
|
# same git version magic as in the Makefile
|
||||||
# for the naming of volume and dmg we want the 3 digits of the full version number
|
# for the naming of volume and dmg we want the 3 digits of the full version number
|
||||||
|
@ -42,7 +32,7 @@ OLDER_MAC_CMAKE="-DCMAKE_OSX_DEPLOYMENT_TARGET=${BASESDK} -DCMAKE_OSX_SYSROOT=${
|
||||||
export PKG_CONFIG_PATH=${DIR}/install-root/lib/pkgconfig:$PKG_CONFIG_PATH
|
export PKG_CONFIG_PATH=${DIR}/install-root/lib/pkgconfig:$PKG_CONFIG_PATH
|
||||||
|
|
||||||
cmake $OLDER_MAC_CMAKE .
|
cmake $OLDER_MAC_CMAKE .
|
||||||
LIBRARY_PATH=${DIR}/install-root/lib make -j8
|
LIBRARY_PATH=${DIR}/install-root/lib make -j
|
||||||
LIBRARY_PATH=${DIR}/install-root/lib make install
|
LIBRARY_PATH=${DIR}/install-root/lib make install
|
||||||
|
|
||||||
# now adjust a few references that macdeployqt appears to miss
|
# now adjust a few references that macdeployqt appears to miss
|
||||||
|
@ -93,6 +83,10 @@ done
|
||||||
|
|
||||||
if [ "$1" = "-nodmg" ] ; then
|
if [ "$1" = "-nodmg" ] ; then
|
||||||
exit 0
|
exit 0
|
||||||
|
elif [ "$1" = "-sign" ] ; then
|
||||||
|
SIGN=1
|
||||||
|
else
|
||||||
|
SIGN=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy things into staging so we can create a nice DMG
|
# copy things into staging so we can create a nice DMG
|
||||||
|
@ -100,7 +94,9 @@ rm -rf ./staging
|
||||||
mkdir ./staging
|
mkdir ./staging
|
||||||
cp -a ./Subsurface.app ./staging
|
cp -a ./Subsurface.app ./staging
|
||||||
|
|
||||||
|
if [ "$SIGN" = "1" ] ; then
|
||||||
sh ${DIR}/subsurface/packaging/macosx/sign
|
sh ${DIR}/subsurface/packaging/macosx/sign
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f ./Subsurface-$VERSION.dmg ]; then
|
if [ -f ./Subsurface-$VERSION.dmg ]; then
|
||||||
rm ./Subsurface-$VERSION.dmg.bak
|
rm ./Subsurface-$VERSION.dmg.bak
|
||||||
|
|
|
@ -137,6 +137,10 @@ while [[ $# -gt 0 ]] ; do
|
||||||
BUILD_DESKTOP="1"
|
BUILD_DESKTOP="1"
|
||||||
BUILD_DOWNLOADER="1"
|
BUILD_DOWNLOADER="1"
|
||||||
;;
|
;;
|
||||||
|
-ftdi)
|
||||||
|
# make sure we include the user space FTDI drivers
|
||||||
|
FTDI="1"
|
||||||
|
;;
|
||||||
-create-appdir)
|
-create-appdir)
|
||||||
# we are building an AppImage as by product
|
# we are building an AppImage as by product
|
||||||
CREATE_APPDIR="1"
|
CREATE_APPDIR="1"
|
||||||
|
@ -147,7 +151,7 @@ while [[ $# -gt 0 ]] ; do
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown command line argument $arg"
|
echo "Unknown command line argument $arg"
|
||||||
echo "Usage: build.sh [-no-bt] [-quick] [-build-deps] [-fat-build] [-src-dir <SUBSURFACE directory>] [-build-prefix <PREFIX>] [-build-with-webkit] [-build-with-map] [-mobile] [-desktop] [-downloader] [-both] [-all] [-create-appdir] [-release]"
|
echo "Usage: build.sh [-no-bt] [-quick] [-build-deps] [-fat-build] [-src-dir <SUBSURFACE directory>] [-build-prefix <PREFIX>] [-build-with-webkit] [-build-with-map] [-mobile] [-desktop] [-downloader] [-both] [-all] [-ftdi] [-create-appdir] [-release]"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -572,13 +576,6 @@ if [ "$QUICK" != "1" ] && [ "$BUILD_DESKTOP$BUILD_MOBILE" != "" ] && ( [[ $QT_VE
|
||||||
else
|
else
|
||||||
$QMAKE "INCLUDEPATH=$INSTALL_ROOT/include" ../googlemaps.pro
|
$QMAKE "INCLUDEPATH=$INSTALL_ROOT/include" ../googlemaps.pro
|
||||||
fi
|
fi
|
||||||
# on Travis the compiler doesn't support c++1z, yet qmake adds that flag;
|
|
||||||
# since things compile fine with c++11, let's just hack that away
|
|
||||||
# similarly, don't use -Wdata-time
|
|
||||||
if [ "$TRAVIS" = "true" ] ; then
|
|
||||||
mv Makefile Makefile.bak
|
|
||||||
cat Makefile.bak | sed -e 's/std=c++1z/std=c++11/g ; s/-Wdate-time//' > Makefile
|
|
||||||
fi
|
|
||||||
make -j4
|
make -j4
|
||||||
if [ "$PLATFORM" = Darwin ] && [[ $QT_VERSION == 6* ]] && [[ $ARCHS == *" "* ]] ; then
|
if [ "$PLATFORM" = Darwin ] && [[ $QT_VERSION == 6* ]] && [[ $ARCHS == *" "* ]] ; then
|
||||||
# we can't build fat binaries directly here, so let's do it in two steps
|
# we can't build fat binaries directly here, so let's do it in two steps
|
||||||
|
@ -612,6 +609,9 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do
|
||||||
else
|
else
|
||||||
EXTRA_OPTS="-DNO_USERMANUAL=ON -DNO_PRINTING=ON"
|
EXTRA_OPTS="-DNO_USERMANUAL=ON -DNO_PRINTING=ON"
|
||||||
fi
|
fi
|
||||||
|
if [ "$FTDI" = "1" ] ; then
|
||||||
|
EXTRA_OPTSi="$EXTRA_OPTS -DFTDISUPPORT"
|
||||||
|
fi
|
||||||
if [ "$BUILD_WITH_QT6" = "1" ] ; then
|
if [ "$BUILD_WITH_QT6" = "1" ] ; then
|
||||||
EXTRA_OPTS="$EXTRA_OPTS -DBUILD_WITH_QT6=ON"
|
EXTRA_OPTS="$EXTRA_OPTS -DBUILD_WITH_QT6=ON"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue