ci(macos): automatically determine default branch for homebrew formula (#2317)
This commit is contained in:
3
.github/workflows/CI.yml
vendored
3
.github/workflows/CI.yml
vendored
@@ -562,10 +562,12 @@ jobs:
|
|||||||
echo "This is a PUSH event"
|
echo "This is a PUSH event"
|
||||||
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 }}"
|
||||||
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 }}"
|
||||||
fi
|
fi
|
||||||
echo "Branch: ${branch}"
|
echo "Branch: ${branch}"
|
||||||
echo "Clone URL: ${clone_url}"
|
echo "Clone URL: ${clone_url}"
|
||||||
@@ -575,6 +577,7 @@ jobs:
|
|||||||
cmake \
|
cmake \
|
||||||
-DGITHUB_BRANCH="${branch}" \
|
-DGITHUB_BRANCH="${branch}" \
|
||||||
-DGITHUB_CLONE_URL="${clone_url}" \
|
-DGITHUB_CLONE_URL="${clone_url}" \
|
||||||
|
-DGITHUB_DEFAULT_BRANCH="${default_branch}" \
|
||||||
-DSUNSHINE_CONFIGURE_HOMEBREW=ON \
|
-DSUNSHINE_CONFIGURE_HOMEBREW=ON \
|
||||||
-DSUNSHINE_CONFIGURE_ONLY=ON \
|
-DSUNSHINE_CONFIGURE_ONLY=ON \
|
||||||
..
|
..
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class @PROJECT_NAME@ < Formula
|
|||||||
tag: "@GITHUB_BRANCH@"
|
tag: "@GITHUB_BRANCH@"
|
||||||
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: "nightly"
|
head "@GITHUB_CLONE_URL@", branch: "@GITHUB_DEFAULT_BRANCH@"
|
||||||
|
|
||||||
depends_on "boost" => :build
|
depends_on "boost" => :build
|
||||||
depends_on "cmake" => :build
|
depends_on "cmake" => :build
|
||||||
|
|||||||
Reference in New Issue
Block a user