Build common DMG for all macOS versions

This commit is contained in:
Jonas Kvinge 2021-04-23 19:05:02 +02:00
parent be95d8409b
commit 63d75a8e17
3 changed files with 84 additions and 172 deletions

View File

@ -1171,8 +1171,8 @@ jobs:
run: dpkg-buildpackage -b -d -uc -us -nc -j2
build-macos-catalina:
name: Build macOS Catalina
build-macos-qt5:
name: Build macOS Qt 5
runs-on: macos-10.15
steps:
- uses: actions/checkout@v1.2.0
@ -1185,7 +1185,7 @@ jobs:
libffi
protobuf
protobuf-c
qt
qt5
gettext
gnutls
fftw
@ -1217,6 +1217,73 @@ jobs:
shell: bash
env:
BUILD_TYPE: Release
MACOSX_DEPLOYMENT_TARGET: 10.15
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
Qt5_DIR: /usr/local/opt/qt5/lib/cmake
Qt5LinguistTools_DIR: /usr/local/opt/qt5/lib/cmake/Qt5LinguistTools
GIO_EXTRA_MODULES: /usr/local/lib/gio/modules
GST_PLUGIN_SCANNER: /usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner
GST_PLUGIN_PATH: /usr/local/lib/gstreamer-1.0
working-directory: build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_WITH_QT5=ON -DBUILD_WERROR=ON -DUSE_BUNDLE=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake
- name: Build
env:
BUILD_TYPE: Release
working-directory: build
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Install
working-directory: build
shell: bash
run: make install
build-macos-qt6:
name: Build macOS Qt 6
runs-on: macos-10.15
steps:
- uses: actions/checkout@v1.2.0
- name: Install packages
run: >
brew install
glib
pkgconfig
boost
libffi
protobuf
protobuf-c
qt6
gettext
gnutls
fftw
sqlite
chromaprint
gstreamer
gst-plugins-base
gst-plugins-good
gst-plugins-bad
gst-plugins-ugly
gst-libav
libcdio
libmtp
create-dmg
taglib
- name: Install Sparkle
run: brew install --cask sparkle
- name: Link Sparkle
shell: bash
run: |
sudo ln -s /usr/local/Caskroom/sparkle/$(ls /usr/local/Caskroom/sparkle | head -n1) /usr/local/opt/sparkle
- name: Create Build Environment
shell: bash
run: cmake -E make_directory build
- name: Configure CMake
shell: bash
env:
BUILD_TYPE: Release
MACOSX_DEPLOYMENT_TARGET: 10.15
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
Qt6_DIR: /usr/local/opt/qt6/lib/cmake
Qt5LinguistTools_DIR: /usr/local/opt/qt6/lib/cmake/Qt6LinguistTools
@ -1241,81 +1308,8 @@ jobs:
run: make dmg
- uses: actions/upload-artifact@v2
with:
name: upload-macos-catalina
path: build/strawberry-*-catalina-*.dmg
build-macos-bigsur:
name: Build macOS Big Sur
runs-on: macos-11.0
steps:
- uses: actions/checkout@v1.2.0
- name: Install packages
run: >
brew install
glib
pkgconfig
boost
libffi
protobuf
protobuf-c
qt
gettext
gnutls
fftw
sqlite
chromaprint
gstreamer
gst-plugins-base
gst-plugins-good
gst-plugins-bad
gst-plugins-ugly
gst-libav
libcdio
libmtp
create-dmg
taglib
- name: Install Sparkle
run: brew install --cask sparkle
- name: Link Sparkle
shell: bash
run: |
sudo ln -s /usr/local/Caskroom/sparkle/$(ls /usr/local/Caskroom/sparkle | head -n1) /usr/local/opt/sparkle
- name: Create Build Environment
shell: bash
run: cmake -E make_directory build
- name: Configure CMake
shell: bash
env:
BUILD_TYPE: Release
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
Qt5_DIR: /usr/local/opt/qt6/lib/cmake
Qt5LinguistTools_DIR: /usr/local/opt/qt6/lib/cmake/Qt6LinguistTools
GIO_EXTRA_MODULES: /usr/local/lib/gio/modules
GST_PLUGIN_SCANNER: /usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner
GST_PLUGIN_PATH: /usr/local/lib/gstreamer-1.0
working-directory: build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_WITH_QT6=ON -DBUILD_WERROR=ON -DUSE_BUNDLE=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/qt6/lib/cmake
- name: Build
env:
BUILD_TYPE: Release
working-directory: build
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Install
working-directory: build
shell: bash
run: make install
- name: Create DMG
working-directory: build
shell: bash
run: make dmg
- uses: actions/upload-artifact@v2
with:
name: upload-macos-bigsur
path: build/strawberry-*-bigsur-*.dmg
name: upload-macos
path: build/strawberry-*.dmg
build-windows-qt5:
@ -1616,12 +1610,12 @@ jobs:
run: makensis strawberry.nsi
upload-macos-catalina:
name: Upload macOS Catalina DMG
upload-macos:
name: Upload macOS DMG
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs:
- build-macos-catalina
- build-macos-qt6
steps:
- uses: actions/checkout@v1.2.0
- uses: actions/download-artifact@v2
@ -1635,29 +1629,6 @@ jobs:
- name: rsync
run: |
set -x
for i in $(find uploads -type f -name 'strawberry-*-catalina-*.dmg'); do
rsync -e "ssh -p 50220 -o StrictHostKeyChecking=no" -va $i travis@echoes.jkvinge.net:/home/travis/builds/macos/catalina/
done
upload-macos-bigsur:
name: Upload macOS Big Sur DMG
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs:
- build-macos-bigsur
steps:
- uses: actions/checkout@v1.2.0
- uses: actions/download-artifact@v2
with:
path: uploads
- name: Install SSH keys
uses: shimataro/ssh-key-action@v2
with:
known_hosts: ${{ secrets.KNOWN_HOSTS2 }}
key: ${{ secrets.SSH_KEY }}
- name: rsync
run: |
set -x
for i in $(find uploads -type f -name 'strawberry-*-bigsur-*.dmg'); do
rsync -e "ssh -p 50220 -o StrictHostKeyChecking=no" -va $i travis@echoes.jkvinge.net:/home/travis/builds/macos/bigsur/
for i in $(find uploads -type f -name 'strawberry-*.dmg'); do
rsync -e "ssh -p 50220 -o StrictHostKeyChecking=no" -va $i travis@echoes.jkvinge.net:/home/travis/builds/macos/
done

View File

@ -1,46 +0,0 @@
sudo: required
language: C++
os: osx
osx_image: xcode11.3
compiler: clang
before_install:
- if ! [ "$DEPLOY_KEY_ENC" == "" ]; then
echo $DEPLOY_KEY_ENC | base64 --decode | openssl aes-256-cbc -K $encrypted_83a41ac424a6_key -iv $encrypted_83a41ac424a6_iv -out ~/.ssh/id_rsa -d ;
chmod 600 ~/.ssh/id_rsa ;
fi
- git fetch --unshallow
- git pull
- brew update
- travis_wait 400 brew upgrade || echo "Failed"
- travis_wait 400 brew upgrade || echo "Failed"
- brew install glib pkgconfig libffi protobuf protobuf-c qt gettext gnutls fftw sqlite chromaprint zlib taglib
- brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav
- brew install libcdio libmtp
- brew install create-dmg
- brew install --cask sparkle
- sudo ln -s /usr/local/Caskroom/sparkle/$(ls /usr/local/Caskroom/sparkle | head -n1) /usr/local/opt/sparkle
- export Qt6_DIR=/usr/local/opt/qt6/lib/cmake
- export Qt6LinguistTools_DIR=/usr/local/opt/qt6/lib/cmake/Qt6LinguistTools
- ls /usr/local/lib/gstreamer-1.0
before_script:
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_QT6=ON -DBUILD_WERROR=ON -DUSE_BUNDLE=ON
script:
- make -j8
- make install
- make dmg2
after_success:
- ls -lh strawberry*.dmg
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [ -f ~/.ssh/id_rsa ]; then
if [[ "$TRAVIS_BRANCH" == "master" ]] || [[ "$TRAVIS_BRANCH" == "travis" ]]; then
rsync -e "ssh -o StrictHostKeyChecking=no" -va strawberry*.dmg travis@echoes.jkvinge.net:/home/travis/builds/macos/mojave/;
fi
fi
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)$/

View File

@ -1,11 +1,10 @@
#find_program(MACDEPLOYQT_EXECUTABLE NAMES macdeployqt PATHS /usr/local/opt/qt6/bin /usr/local/opt/qt5/bin /usr/local/bin REQUIRED)
#if(MACDEPLOYQT_EXECUTABLE)
# message(STATUS "Found macdeployqt: ${MACDEPLOYQT_EXECUTABLE}")
#else()
# message(WARNING "Missing macdeployqt executable.")
#endif()
set(MACDEPLOYQT_EXECUTABLE "${CMAKE_BINARY_DIR}/3rdparty/macdeployqt/macdeployqt")
if(MACDEPLOYQT_EXECUTABLE)
message(STATUS "Found macdeployqt: ${MACDEPLOYQT_EXECUTABLE}")
else()
message(WARNING "Missing macdeployqt executable.")
endif()
find_program(CREATEDMG_EXECUTABLE NAMES create-dmg REQUIRED)
if(CREATEDMG_EXECUTABLE)
@ -14,24 +13,12 @@ else()
message(WARNING "Missing create-dmg executable.")
endif()
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/dist/macos/macversion.sh OUTPUT_VARIABLE MACOS_VERSION_PACKAGE OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT MACOS_VERSION_PACKAGE)
message(WARNING "Could not set macOS version.")
endif()
if(MACDEPLOYQT_EXECUTABLE AND CREATEDMG_EXECUTABLE AND MACOS_VERSION_PACKAGE)
if(MACDEPLOYQT_EXECUTABLE AND CREATEDMG_EXECUTABLE)
add_custom_target(dmg
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/strawberry.app/Contents/Frameworks/
COMMAND cp -r /usr/local/opt/sparkle/Sparkle.framework ${CMAKE_BINARY_DIR}/strawberry.app/Contents/Frameworks/
COMMAND ${MACDEPLOYQT_EXECUTABLE} strawberry.app -verbose=3 -executable=${CMAKE_BINARY_DIR}/strawberry.app/Contents/PlugIns/strawberry-tagreader
COMMAND ${CREATEDMG_EXECUTABLE} --volname strawberry --background "${CMAKE_SOURCE_DIR}/dist/macos/dmg_background.png" --app-drop-link 450 218 --icon strawberry.app 150 218 --window-size 600 450 strawberry-${STRAWBERRY_VERSION_PACKAGE}-${MACOS_VERSION_PACKAGE}-${CMAKE_HOST_SYSTEM_PROCESSOR}.dmg strawberry.app
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(dmg2
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/strawberry.app/Contents/Frameworks/
COMMAND cp -r /usr/local/opt/sparkle/Sparkle.framework ${CMAKE_BINARY_DIR}/strawberry.app/Contents/Frameworks/
COMMAND ${MACDEPLOYQT_EXECUTABLE} strawberry.app -verbose=3 -executable=${CMAKE_BINARY_DIR}/strawberry.app/Contents/PlugIns/strawberry-tagreader
COMMAND ${CREATEDMG_EXECUTABLE} --skip-jenkins --volname strawberry --background "${CMAKE_SOURCE_DIR}/dist/macos/dmg_background.png" --app-drop-link 450 218 --icon strawberry.app 150 218 --window-size 600 450 strawberry-${STRAWBERRY_VERSION_PACKAGE}-${MACOS_VERSION_PACKAGE}-${CMAKE_HOST_SYSTEM_PROCESSOR}.dmg strawberry.app
COMMAND ${CREATEDMG_EXECUTABLE} --volname strawberry --background "${CMAKE_SOURCE_DIR}/dist/macos/dmg_background.png" --app-drop-link 450 218 --icon strawberry.app 150 218 --window-size 600 450 strawberry-${STRAWBERRY_VERSION_PACKAGE}-${CMAKE_HOST_SYSTEM_PROCESSOR}.dmg strawberry.app
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
endif()