fix(homebrew): use tag instead of branch in formula (#2705)
This commit is contained in:
20
.github/workflows/CI.yml
vendored
20
.github/workflows/CI.yml
vendored
@@ -493,8 +493,10 @@ jobs:
|
|||||||
os_name: "macos"
|
os_name: "macos"
|
||||||
- os_version: "latest"
|
- os_version: "latest"
|
||||||
os_name: "ubuntu"
|
os_name: "ubuntu"
|
||||||
|
- os_version: "latest" # this job will only configure the formula for release, no validation
|
||||||
|
os_name: "ubuntu"
|
||||||
release: true
|
release: true
|
||||||
name: Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }})
|
name: Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }})
|
||||||
runs-on: ${{ matrix.os_name }}-${{ matrix.os_version }}
|
runs-on: ${{ matrix.os_name }}-${{ matrix.os_version }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -515,14 +517,23 @@ jobs:
|
|||||||
clone_url=${{ github.event.repository.clone_url }}
|
clone_url=${{ github.event.repository.clone_url }}
|
||||||
branch="${{ github.ref_name }}"
|
branch="${{ github.ref_name }}"
|
||||||
default_branch="${{ github.event.repository.default_branch }}"
|
default_branch="${{ github.event.repository.default_branch }}"
|
||||||
|
|
||||||
|
if [ "${{ matrix.release }}" == "true" ]; then
|
||||||
|
# we will publish the formula with the release tag
|
||||||
|
tag="${{ needs.setup_release.outputs.release_tag }}"
|
||||||
|
else
|
||||||
|
tag="${{ github.sha }}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "This is a PR event"
|
echo "This is a PR event"
|
||||||
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
|
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
|
||||||
branch="${{ github.event.pull_request.head.ref }}"
|
branch="${{ github.event.pull_request.head.ref }}"
|
||||||
default_branch="${{ github.event.pull_request.head.repo.default_branch }}"
|
default_branch="${{ github.event.pull_request.head.repo.default_branch }}"
|
||||||
|
tag="${{ github.event.pull_request.head.ref }}"
|
||||||
fi
|
fi
|
||||||
echo "Branch: ${branch}"
|
echo "Branch: ${branch}"
|
||||||
echo "Clone URL: ${clone_url}"
|
echo "Clone URL: ${clone_url}"
|
||||||
|
echo "Tag: ${tag}"
|
||||||
|
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
@@ -532,6 +543,7 @@ jobs:
|
|||||||
-DGITHUB_COMMIT="${commit}" \
|
-DGITHUB_COMMIT="${commit}" \
|
||||||
-DGITHUB_CLONE_URL="${clone_url}" \
|
-DGITHUB_CLONE_URL="${clone_url}" \
|
||||||
-DGITHUB_DEFAULT_BRANCH="${default_branch}" \
|
-DGITHUB_DEFAULT_BRANCH="${default_branch}" \
|
||||||
|
-DGITHUB_TAG="${tag}" \
|
||||||
-DSUNSHINE_CONFIGURE_HOMEBREW=ON \
|
-DSUNSHINE_CONFIGURE_HOMEBREW=ON \
|
||||||
-DSUNSHINE_CONFIGURE_ONLY=ON \
|
-DSUNSHINE_CONFIGURE_ONLY=ON \
|
||||||
..
|
..
|
||||||
@@ -552,7 +564,9 @@ jobs:
|
|||||||
path: homebrew/
|
path: homebrew/
|
||||||
|
|
||||||
- name: Setup Xvfb
|
- name: Setup Xvfb
|
||||||
if: ${{ runner.os == 'Linux' }}
|
if: |
|
||||||
|
matrix.release != true &&
|
||||||
|
runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
@@ -564,6 +578,8 @@ jobs:
|
|||||||
echo "DISPLAY=${DISPLAY}" >> $GITHUB_ENV
|
echo "DISPLAY=${DISPLAY}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Validate Homebrew Formula
|
- name: Validate Homebrew Formula
|
||||||
|
if: |
|
||||||
|
matrix.release != true
|
||||||
uses: LizardByte/homebrew-release-action@v2024.612.21058
|
uses: LizardByte/homebrew-release-action@v2024.612.21058
|
||||||
with:
|
with:
|
||||||
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
|
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class @PROJECT_NAME@ < Formula
|
|||||||
desc "@PROJECT_DESCRIPTION@"
|
desc "@PROJECT_DESCRIPTION@"
|
||||||
homepage "@PROJECT_HOMEPAGE_URL@"
|
homepage "@PROJECT_HOMEPAGE_URL@"
|
||||||
url "@GITHUB_CLONE_URL@",
|
url "@GITHUB_CLONE_URL@",
|
||||||
tag: "@GITHUB_BRANCH@"
|
tag: "@GITHUB_TAG@"
|
||||||
version "@PROJECT_VERSION@"
|
version "@PROJECT_VERSION@"
|
||||||
license all_of: ["GPL-3.0-only"]
|
license all_of: ["GPL-3.0-only"]
|
||||||
head "@GITHUB_CLONE_URL@", branch: "@GITHUB_DEFAULT_BRANCH@"
|
head "@GITHUB_CLONE_URL@", branch: "@GITHUB_DEFAULT_BRANCH@"
|
||||||
|
|||||||
Reference in New Issue
Block a user