Skip to content
This repository was archived by the owner on Dec 25, 2025. It is now read-only.

Commit c4a9755

Browse files
authored
Add Homebrew reset step in build workflow
Reset Homebrew to a pristine state, cleaning up taps and local modifications, and performing a sanity check.
1 parent ed9e129 commit c4a9755

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

.github/workflows/build.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,28 @@ jobs:
3434
- name: Use Xcode 15
3535
run: sudo xcode-select -switch /Applications/Xcode_15.2.app/Contents/Developer
3636

37-
- name: debug data
37+
- name: Reset Homebrew to pristine state
3838
run: |
39-
echo "understanding why jws is silly"
40-
grep -r "formula.jws.json" $(brew --repo)
41-
brew tap
42-
echo complete understanding
43-
39+
# remove unnecessary taps
40+
brew untap homebrew/cask 2>/dev/null || true
41+
brew untap homebrew/core 2>/dev/null || true
42+
43+
# stash and clean any local modifications in core and cask
44+
git -C "$(brew --repo homebrew/core)" stash -u || true
45+
git -C "$(brew --repo homebrew/core)" clean -d -f || true
46+
git -C "$(brew --repo homebrew/cask)" stash -u || true
47+
git -C "$(brew --repo homebrew/cask)" clean -d -f || true
48+
49+
# fully reset Homebrew metadata
50+
brew update-reset
51+
52+
# cleanup old builds, broken symlinks, cache
53+
brew cleanup -s
54+
rm -rf "$(brew --cache)"/*
55+
56+
# sanity check
4457
brew doctor
45-
brew config
46-
47-
brew install ffmpeg@7
48-
ls $(brew --prefix ffmpeg@7)
4958

50-
5159
- name: Install MacPorts
5260
run: |
5361
# install ports by defualt to /opt/local/bin

0 commit comments

Comments
 (0)