From ed0ddeaf3e1a7b7cafb4a721fa19988cff9611d7 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 21 May 2021 14:56:01 -0700 Subject: [PATCH] fix: make sure homebrew-core is up to date --- CHANGELOG.md | 2 +- ci/steps/brew-bump.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3f0e42d1..746bf472d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,7 +75,7 @@ VS Code v1.56.1 ### Development -- fix(ci): update brew-bump.sh to update remote first #0000 @jsjoeio +- fix(ci): update brew-bump.sh to update remote first #3438 @jsjoeio ## 3.10.1 diff --git a/ci/steps/brew-bump.sh b/ci/steps/brew-bump.sh index 0d669f294..4e4500259 100755 --- a/ci/steps/brew-bump.sh +++ b/ci/steps/brew-bump.sh @@ -5,9 +5,36 @@ main() { cd "$(dirname "$0")/../.." # Only sourcing this so we get access to $VERSION source ./ci/lib.sh + + # NOTE: we need to make sure cdrci/homebrew-core + # is up-to-date + # otherwise, brew bump-formula-pr will use an + # outdated base + echo "Cloning cdrci/homebrew-core" + git clone https://github.com/cdrci/homebrew-core.git + + echo "Changing into homebrew-core directory" + cd homebrew-core && pwd + + echo "Adding Homebrew/homebrew-core as $(upstream)" + git remote add upstream https://github.com/Homebrew/homebrew-core.git + + echo "Fetching upstream commits..." + git fetch upstream + + echo "Merging in latest changes" + git merge upstream/master + + echo "Pushing changes to cdrci/homebrew-core fork on GitHub" + git push origin master + # Find the docs for bump-formula-pr here # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/bump-formula-pr.rb#L18 brew bump-formula-pr --force --version="${VERSION}" code-server --no-browse --no-audit + + # Clean up and remove homebrew-core + cd .. + rm -rf homebrew-core } main "$@"