Skip to content

Commit

Permalink
Add MacOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed May 1, 2022
1 parent 12bf5cf commit 31b7fbf
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,60 @@ jobs:
last_version: ${{ needs.check_changelog.outputs.last_version }}
release_body: ${{ needs.check_changelog.outputs.release_body }}

build_mac:
name: MacOS
runs-on: macos-11
needs: check_changelog

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Dependencies MacOS
run: |
# install dependencies using homebrew
brew install boost cmake ffmpeg libopusenc openssl
echo "LIBRARY_PATH=${{ env.LIBRARY_PATH }}:/usr/local/opt/openssl/lib/" >> $GITHUB_ENV
- name: Build MacOS
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets ..
make -j ${nproc}
- name: Package MacOS
run: |
mkdir -p artifacts
cd build
# package
cpack -G BUNDLE
cpack -G DMG
# move
mv Sunshine.bundle ../artifacts/sunshine-macos.bundle
mv Sunshine.dmg ../artifacts/sunshine-macos.dmg
- name: Upload Artifacts
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
name: sunshine-macos
path: artifacts/

- name: Create Release
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: SunshineStream/actions/create_release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
next_version: ${{ needs.check_changelog.outputs.next_version }}
last_version: ${{ needs.check_changelog.outputs.last_version }}
release_body: ${{ needs.check_changelog.outputs.release_body }}

build_win:
name: Windows
runs-on: windows-2019
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,9 @@ if(APPLE) # TODO: test
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} COMPONENT Runtime)

# TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop
# set(CPACK_BUNDLE_NAME "Sunshine")
# set(CPACK_BUNDLE_PLIST "${SUNSHINE_ASSETS_DIR}/info.plist")
# set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns")
set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_BUNDLE_PLIST "${SUNSHINE_ASSETS_DIR}/info.plist")
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns")
endif()
if(UNIX AND NOT APPLE)
install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${SUNSHINE_CONFIG_DIR}")
Expand Down

0 comments on commit 31b7fbf

Please sign in to comment.