-
-
Notifications
You must be signed in to change notification settings - Fork 987
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b3e681
commit 2bebc23
Showing
7 changed files
with
183 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -637,6 +637,97 @@ jobs: | |
discussionCategory: announcements | ||
prerelease: ${{ needs.setup_release.outputs.pre_release }} | ||
|
||
build_mac_brew: | ||
needs: [check_changelog, setup_release] | ||
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: Homebrew (macOS-${{ matrix.os_version }}) | ||
runs-on: macos-${{ matrix.os_version }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Dependencies Homebrew | ||
run: | | ||
# install dependencies using homebrew | ||
brew install cmake | ||
- name: Configure formula | ||
run: | | ||
# variables for formula | ||
branch=${GITHUB_HEAD_REF} | ||
# check the branch variable | ||
if [ -z "$branch" ] | ||
then | ||
echo "This is a PUSH event" | ||
clone_url=${{ github.event.repository.clone_url }} | ||
branch="${{ github.ref_name }}" | ||
else | ||
echo "This is a PR event" | ||
clone_url=${{ github.event.pull_request.head.repo.clone_url }} | ||
branch="${{ github.event.pull_request.head.ref }}" | ||
fi | ||
echo "Branch: ${branch}" | ||
echo "Clone URL: ${clone_url}" | ||
mkdir build | ||
cd build | ||
cmake \ | ||
-DGITHUB_BRANCH="${branch}" \ | ||
-DGITHUB_CLONE_URL="${clone_url}" \ | ||
-DSUNSHINE_CONFIGURE_HOMEBREW=ON \ | ||
-DSUNSHINE_CONFIGURE_ONLY=ON \ | ||
.. | ||
cd .. | ||
# copy formula to artifacts | ||
mkdir -p homebrew/Formula | ||
cp -f ./build/sunshine.rb ./homebrew/Formula/sunshine.rb | ||
# testing | ||
cat ./homebrew/Formula/sunshine.rb | ||
- name: Install formula | ||
run: | | ||
# sometimes the install will fail due to a symbolic link error | ||
sudo rm -f '/usr/local/bin/2to3-3.11' | ||
sudo rm -f '/usr/local/bin/idle3.11' | ||
brew install --verbose ./build/sunshine.rb | ||
- name: Test formula | ||
run: | | ||
brew test sunshine | ||
- name: Upload Artifacts | ||
if: ${{ matrix.release }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: sunshine-homebrew | ||
path: homebrew/ | ||
|
||
- name: Publish Homebrew Formula | ||
if: | | ||
(github.repository_owner == 'LizardByte' && | ||
needs.setup_release.outputs.create_release == 'true' && | ||
github.ref == 'refs/heads/master' && | ||
matrix.release) | ||
uses: LizardByte/[email protected] | ||
with: | ||
git_email: ${{ secrets.GH_BOT_EMAIL }} | ||
git_username: ${{ secrets.GH_BOT_NAME }} | ||
token: ${{ secrets.GH_BOT_TOKEN }} | ||
|
||
build_mac_port: | ||
needs: [check_changelog, setup_release] | ||
strategy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
require "language/node" | ||
|
||
class @PROJECT_NAME@ < Formula | ||
desc "@PROJECT_DESCRIPTION@" | ||
homepage "@PROJECT_HOMEPAGE_URL@" | ||
url "@GITHUB_CLONE_URL@", | ||
tag: "@GITHUB_BRANCH@" | ||
version "@PROJECT_VERSION@" | ||
license all_of: ["GPL-3.0-only"] | ||
head "@GITHUB_CLONE_URL@" | ||
|
||
depends_on "boost" => :build | ||
depends_on "cmake" => :build | ||
depends_on "pkg-config" => :build | ||
depends_on "curl" | ||
depends_on "miniupnpc" | ||
depends_on "node" | ||
depends_on "openssl" | ||
depends_on "opus" | ||
|
||
def install | ||
args = %W[ | ||
-DBUIld_WERROR=ON | ||
-DCMAKE_INSTALL_PREFIX=#{prefix} | ||
-DOPENSSL_ROOT_DIR=#{Formula["openssl"].opt_prefix} | ||
-DSUNSHINE_ASSETS_DIR=sunshine/assets | ||
-DSUNSHINE_BUILD_HOMEBREW=ON | ||
] | ||
system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args | ||
|
||
cd "build" do | ||
system "make", "-j" | ||
system "make", "install" | ||
end | ||
end | ||
|
||
service do | ||
run [opt_bin/"sunshine", "~/.config/sunshine/sunshine.conf"] | ||
end | ||
|
||
test do | ||
# test that the binary runs at all | ||
output = shell_output("#{bin}/sunshine --version").strip | ||
puts output | ||
|
||
# todo: add unit tests | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters