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 }} prerelease: ${{ needs.setup_release.outputs.pre_release }}
build_mac: build_mac:
name: MacOS
runs-on: macos-11
needs: [check_changelog, setup_release] needs: [check_changelog, setup_release]
env: env:
BOOST_VERSION: 1.83.0 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: steps:
- name: Checkout - name: Checkout
@ -520,24 +532,32 @@ jobs:
- name: Setup Dependencies MacOS - name: Setup Dependencies MacOS
run: | run: |
if [[ ${{ matrix.arch }} == "arm64" ]]; then
brew_prefix="/opt/homebrew"
else
brew_prefix="/usr/local"
fi
# install dependencies using homebrew # install dependencies using homebrew
brew install cmake curl miniupnpc node openssl opus pkg-config brew install cmake curl miniupnpc node openssl opus pkg-config
# fix openssl header not found # fix openssl header not found
# ln -sf /usr/local/opt/openssl/include/openssl /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"
# by installing boost from source, several headers cannot be found... ln -sf $openssl_path ${brew_prefix}/include/openssl
# the above commented out link only works if boost is installed from homebrew... does not make sense ls -l ${brew_prefix}/include/openssl
ln -sf $(find /usr/local/Cellar -type d -name "openssl" -path "*/openssl@3/*/include" | head -n 1) \
/usr/local/include/openssl
# fix opus header not found # fix opus header not found
ln -sf $(find /usr/local/Cellar -type d -name "opus" -path "*/opus/*/include" | head -n 1) \ opus_path=$(find ${brew_prefix}/Cellar -type d -name "opus" -path "*/opus/*/include" | head -n 1)
/usr/local/include/opus echo "Opus path: $opus_path"
ln -sf $opus_path ${brew_prefix}/include/opus
ls -l ${brew_prefix}/include/opus
# fix miniupnpc header not found # fix miniupnpc header not found
ln -sf $(find /usr/local/Cellar -type d -name "miniupnpc" -path "*/miniupnpc/*/include" | head -n 1) \ upnp_path=$(find ${brew_prefix}/Cellar -type d -name "miniupnpc" -path "*/miniupnpc/*/include" | head -n 1)
/usr/local/include/miniupnpc echo "Miniupnpc path: $upnp_path"
ln -sf $upnp_path ${brew_prefix}/include/miniupnpc
ls -l ${brew_prefix}/include/miniupnpc
- name: Install Boost - name: Install Boost
# installing boost from homebrew takes 30 minutes in a GitHub runner # installing boost from homebrew takes 30 minutes in a GitHub runner
@ -594,15 +614,13 @@ jobs:
# package # package
cpack -G DragNDrop cpack -G DragNDrop
mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine.dmg mv ./cpack_artifacts/Sunshine.dmg \
../artifacts/sunshine-macos-${{ matrix.os_version }}-${{ matrix.arch }}.dmg
# cpack -G Bundle
# mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-bundle.dmg
- name: Upload Artifacts - name: Upload Artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: sunshine-macos name: sunshine-macos-${{ matrix.os_version }}-${{ matrix.arch }}
path: artifacts/ path: artifacts/
- name: Create/Update GitHub Release - name: Create/Update GitHub Release
@ -620,9 +638,19 @@ jobs:
prerelease: ${{ needs.setup_release.outputs.pre_release }} prerelease: ${{ needs.setup_release.outputs.pre_release }}
build_mac_port: build_mac_port:
name: Macports
needs: [check_changelog, setup_release] 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: steps:
- name: Checkout - name: Checkout
@ -725,13 +753,14 @@ jobs:
echo "::endgroup::" echo "::endgroup::"
- name: Upload Artifacts - name: Upload Artifacts
if: ${{ matrix.release == 'true' }}
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: sunshine-macports name: sunshine-macports
path: artifacts/ path: artifacts/
- name: Create/Update GitHub Release - 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 uses: ncipollo/release-action@v1
with: with:
name: ${{ needs.setup_release.outputs.release_name }} name: ${{ needs.setup_release.outputs.release_name }}

View File

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

View File

@ -281,14 +281,14 @@ Install
.. tab:: macOS .. 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 .. tab:: dmg
.. warning:: The `dmg` does not include runtime dependencies. This package is not recommended for most users. .. warning:: The `dmg` does not include runtime dependencies. This package is not recommended for most users.
No support will be provided! 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: Uninstall:
.. code-block:: bash .. code-block:: bash

View File

@ -20,9 +20,23 @@ Install Requirements
.. code-block:: bash .. code-block:: bash
brew install boost cmake miniupnpc node opus pkg-config 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 If there are issues with an SSL header that is not found:
ln -s ../opt/openssl/include/openssl . .. 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 Build
----- -----

View File

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