build(macos): add build strategy matrix (#2211)

This commit is contained in:
ReenigneArcher 2024-03-05 08:56:09 -05:00 committed by GitHub
parent 9f94eebd32
commit 4ebc7b5cef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 73 additions and 27 deletions

View File

@ -506,11 +506,23 @@ jobs:
prerelease: ${{ needs.setup_release.outputs.pre_release }}
build_mac:
name: MacOS
runs-on: macos-11
needs: [check_changelog, setup_release]
env:
BOOST_VERSION: 1.83.0
strategy:
fail-fast: false # false to test all, true to fail entire job if any fail
matrix:
include:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
# while GitHub has larger macOS runners, they are not available for our repos :(
- os_version: "12"
arch: "x86_64"
- os_version: "13"
arch: "x86_64"
- os_version: "14"
arch: "arm64"
name: macOS-${{ matrix.os_version }} ${{ matrix.arch }}
runs-on: macos-${{ matrix.os_version }}
steps:
- name: Checkout
@ -520,24 +532,32 @@ jobs:
- name: Setup Dependencies MacOS
run: |
if [[ ${{ matrix.arch }} == "arm64" ]]; then
brew_prefix="/opt/homebrew"
else
brew_prefix="/usr/local"
fi
# install dependencies using homebrew
brew install cmake curl miniupnpc node openssl opus pkg-config
# fix openssl header not found
# ln -sf /usr/local/opt/openssl/include/openssl /usr/local/include/openssl
# by installing boost from source, several headers cannot be found...
# the above commented out link only works if boost is installed from homebrew... does not make sense
ln -sf $(find /usr/local/Cellar -type d -name "openssl" -path "*/openssl@3/*/include" | head -n 1) \
/usr/local/include/openssl
openssl_path=$(find ${brew_prefix}/Cellar -type d -name "openssl" -path "*/openssl@3/*/include" | head -n 1)
echo "OpenSSL path: $openssl_path"
ln -sf $openssl_path ${brew_prefix}/include/openssl
ls -l ${brew_prefix}/include/openssl
# fix opus header not found
ln -sf $(find /usr/local/Cellar -type d -name "opus" -path "*/opus/*/include" | head -n 1) \
/usr/local/include/opus
opus_path=$(find ${brew_prefix}/Cellar -type d -name "opus" -path "*/opus/*/include" | head -n 1)
echo "Opus path: $opus_path"
ln -sf $opus_path ${brew_prefix}/include/opus
ls -l ${brew_prefix}/include/opus
# fix miniupnpc header not found
ln -sf $(find /usr/local/Cellar -type d -name "miniupnpc" -path "*/miniupnpc/*/include" | head -n 1) \
/usr/local/include/miniupnpc
upnp_path=$(find ${brew_prefix}/Cellar -type d -name "miniupnpc" -path "*/miniupnpc/*/include" | head -n 1)
echo "Miniupnpc path: $upnp_path"
ln -sf $upnp_path ${brew_prefix}/include/miniupnpc
ls -l ${brew_prefix}/include/miniupnpc
- name: Install Boost
# installing boost from homebrew takes 30 minutes in a GitHub runner
@ -594,15 +614,13 @@ jobs:
# package
cpack -G DragNDrop
mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine.dmg
# cpack -G Bundle
# mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-bundle.dmg
mv ./cpack_artifacts/Sunshine.dmg \
../artifacts/sunshine-macos-${{ matrix.os_version }}-${{ matrix.arch }}.dmg
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: sunshine-macos
name: sunshine-macos-${{ matrix.os_version }}-${{ matrix.arch }}
path: artifacts/
- name: Create/Update GitHub Release
@ -620,9 +638,19 @@ jobs:
prerelease: ${{ needs.setup_release.outputs.pre_release }}
build_mac_port:
name: Macports
needs: [check_changelog, setup_release]
runs-on: macos-11
strategy:
fail-fast: false # false to test all, true to fail entire job if any fail
matrix:
include:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
# while GitHub has larger macOS runners, they are not available for our repos :(
- os_version: "12"
release: true
- os_version: "13"
- os_version: "14"
name: Macports (macOS-${{ matrix.os_version }})
runs-on: macos-${{ matrix.os_version }}
steps:
- name: Checkout
@ -725,13 +753,14 @@ jobs:
echo "::endgroup::"
- name: Upload Artifacts
if: ${{ matrix.release == 'true' }}
uses: actions/upload-artifact@v4
with:
name: sunshine-macports
path: artifacts/
- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
if: ${{ needs.setup_release.outputs.create_release == 'true' && matrix.release == 'true' }}
uses: ncipollo/release-action@v1
with:
name: ${{ needs.setup_release.outputs.release_name }}

View File

@ -32,11 +32,11 @@ System Requirements
+------------+------------------------------------------------------------+
| OS | Windows: 10+ (Windows Server not supported) |
| +------------------------------------------------------------+
| | macOS: 11.7+ |
| | macOS: 12+ |
| +------------------------------------------------------------+
| | Linux/Debian: 11 (bullseye) |
| +------------------------------------------------------------+
| | Linux/Fedora: 37+ |
| | Linux/Fedora: 38+ |
| +------------------------------------------------------------+
| | Linux/Ubuntu: 20.04+ (focal) |
+------------+------------------------------------------------------------+

View File

@ -281,14 +281,14 @@ Install
.. tab:: macOS
.. important:: Sunshine on macOS is experimental. Gamepads do not work. Other features may not work as expected.
.. important:: Sunshine on macOS is experimental. Gamepads do not work.
.. tab:: dmg
.. warning:: The `dmg` does not include runtime dependencies. This package is not recommended for most users.
No support will be provided!
#. Download the ``sunshine.dmg`` file and install it.
#. Download the ``sunshine-<macos_version>-<cpu_architecture>.dmg`` file and install it.
Uninstall:
.. code-block:: bash

View File

@ -20,9 +20,23 @@ Install Requirements
.. code-block:: bash
brew install boost cmake miniupnpc node opus pkg-config
# if there are issues with an SSL header that is not found:
cd /usr/local/include
ln -s ../opt/openssl/include/openssl .
If there are issues with an SSL header that is not found:
.. tab:: Intel
.. code-block:: bash
pushd /usr/local/include
ln -s ../opt/openssl/include/openssl .
popd
.. tab:: Apple Silicon
.. code-block:: bash
pushd /opt/homebrew/include
ln -s ../opt/openssl/include/openssl .
popd
Build
-----

View File

@ -106,8 +106,11 @@ main(int argc, char *argv[]) {
setlocale(LC_ALL, ".UTF-8");
#endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// Use UTF-8 conversion for the default C++ locale (used by boost::log)
std::locale::global(std::locale(std::locale(), new std::codecvt_utf8<wchar_t>));
#pragma GCC diagnostic pop
mail::man = std::make_shared<safe::mail_raw_t>();