Skip to content

Commit

Permalink
test new homebrew release action
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Mar 9, 2024
1 parent 659e0d7 commit 6e733aa
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 30 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -691,21 +691,11 @@ jobs:
cd ..
# copy formula to artifacts
mkdir -p homebrew/Formula
cp -f ./build/sunshine.rb ./homebrew/Formula/sunshine.rb
mkdir -p homebrew
cp -f ./build/sunshine.rb ./homebrew/sunshine.rb
# testing
cat ./homebrew/Formula/sunshine.rb
- name: Install formula
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: |
brew install --verbose ./build/sunshine.rb
- name: Test formula
run: |
brew test sunshine
cat ./homebrew/sunshine.rb
- name: Upload Artifacts
if: ${{ matrix.release }}
Expand All @@ -714,16 +704,28 @@ jobs:
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]
- name: Should Publish Homebrew Formula
id: homebrew_publish
run: |
PUBLISH=false
if [[ \
"${{ matrix.release }}" == "true" && \
"${{ github.repository_owner }}" == "LizardByte" && \
"${{ needs.setup_release.outputs.create_release }}" == "true" && \
"${{ github.ref }}" == "refs/heads/master" \
]]; then
PUBLISH=true
fi
echo "publish=${PUBLISH}" >> $GITHUB_OUTPUT
- name: Validate and Publish Homebrew Formula
uses: LizardByte/homebrew-release-action@fix-checkout-paths-must-be-under-github-workspace
with:
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
git_email: ${{ secrets.GH_BOT_EMAIL }}
git_username: ${{ secrets.GH_BOT_NAME }}
publish: ${{ steps.homebrew_publish.outputs.publish }}
token: ${{ secrets.GH_BOT_TOKEN }}

build_mac_port:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.18)

# todo - set version to 0.0.0 once confident in automated versioning
project(Sunshine VERSION 0.22.0
DESCRIPTION "Sunshine is a self-hosted game stream host for Moonlight."
DESCRIPTION "Self-hosted game stream host for Moonlight"
HOMEPAGE_URL "https://app.lizardbyte.dev/Sunshine")

set(PROJECT_LICENSE "GPL-3.0")
Expand Down
18 changes: 9 additions & 9 deletions packaging/macos/sunshine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class @PROJECT_NAME@ < Formula
tag: "@GITHUB_BRANCH@"
version "@PROJECT_VERSION@"
license all_of: ["GPL-3.0-only"]
head "@GITHUB_CLONE_URL@"
head "@GITHUB_CLONE_URL@", branch: "nightly"

depends_on "boost" => :build
depends_on "cmake" => :build
Expand Down Expand Up @@ -38,14 +38,6 @@ def install
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

def caveats
<<~EOS
Thanks for installing @PROJECT_NAME@!
Expand All @@ -59,4 +51,12 @@ def caveats
Gamepads are not currently supported on macOS.
EOS
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

0 comments on commit 6e733aa

Please sign in to comment.