File tree Expand file tree Collapse file tree 2 files changed +36
-6
lines changed Expand file tree Collapse file tree 2 files changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,6 @@ jobs:
370
370
371
371
upgrade :
372
372
name : " Upgrade test"
373
- # The QEMU bottle URL needs to be updated when the runner is upgraded from Monterey
374
373
runs-on : macos-12
375
374
timeout-minutes : 120
376
375
strategy :
@@ -388,15 +387,14 @@ jobs:
388
387
with :
389
388
template : https://raw.githubusercontent.com/lima-vm/lima/${{ matrix.oldver }}/examples/ubuntu-lts.yaml
390
389
- name : Install test dependencies
390
+ env :
391
+ # brew-install-version.sh calls `gh`, which needs the token
392
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
391
393
run : |
392
394
brew install bash coreutils
393
395
# QEMU 9.1.0 seems to break on GitHub runners, both on Monterey and Ventura
394
396
# We revert back to 8.2.1, which seems to work fine
395
- # The SHA1 for the Monterey bottle comes from https://github.com/Homebrew/homebrew-core/blob/4c7ffca/Formula/q/qemu.rb
396
- brew uninstall --ignore-dependencies --force qemu
397
- curl -L -o qemu-8.2.1.monterey.bottle.tar.gz -H "Authorization: Bearer QQ==" \
398
- https://ghcr.io/v2/homebrew/core/qemu/blobs/sha256:41c77f6bac3e8c1664c665fbe2b19b19ee9da57f8e1ad6697348286710cc3575
399
- brew install --ignore-dependencies ./qemu-8.2.1.monterey.bottle.tar.gz
397
+ ./hack/brew-install-version.sh qemu 8.2.1
400
398
- name : Test
401
399
uses : nick-fields/retry@v3
402
400
with :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # This script only works for formulas in the homebrew-core
3
+
4
+ set -eu -o pipefail
5
+
6
+ FORMULA=$1
7
+ VERSION=$2
8
+
9
+ export HOMEBREW_NO_AUTO_UPDATE=1
10
+ export HOMEBREW_NO_INSTALL_UPGRADE=1
11
+ export HOMEBREW_NO_INSTALL_CLEANUP=1
12
+
13
+ TAP=lima/tap
14
+ if ! brew tap | grep -q " ^${TAP} \$ " ; then
15
+ brew tap-new " $TAP "
16
+ fi
17
+
18
+ # Get the commit id for the commit that updated this bottle
19
+ SHA=$( gh search commits --repo homebrew/homebrew-core " ${FORMULA} : update ${VERSION} bottle" --json sha --jq " last|.sha" )
20
+ if [[ -z $SHA ]]; then
21
+ echo " ${FORMULA} ${VERSION} not found"
22
+ exit 1
23
+ fi
24
+
25
+ OUTPUT=" $( brew --repo " $TAP " ) /Formula/${FORMULA} .rb"
26
+ RAW=" https://raw.githubusercontent.com/Homebrew/homebrew-core"
27
+ curl -s " ${RAW} /${SHA} /Formula/${FORMULA:: 1} /${FORMULA} .rb" -o " $OUTPUT "
28
+
29
+ if brew ls -1 | grep -q " ^${FORMULA} \$ " ; then
30
+ brew uninstall " $FORMULA " --ignore-dependencies
31
+ fi
32
+ brew install " ${TAP} /${FORMULA} "
You can’t perform that action at this time.
0 commit comments