mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
The old Xcode sticks around, so make sure we sort in reverse to pick the newer version. Technically we should use something like sort -Vr, but -V doesn't exist on macOS. But that won't be a problem until Xcode 100, which my great great grand children can worry about.
18 lines
546 B
YAML
18 lines
546 B
YAML
name: Update clang
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- shell: bash
|
|
run: |
|
|
softwareupdate -l
|
|
label=$((softwareupdate -l 2>/dev/null | grep 'Label:' | grep -o 'Command Line Tools for Xcode.*' | head -1) || echo '')
|
|
if [ -n "$label" ]; then
|
|
softwareupdate -i "$label"
|
|
xcode_path=$(ls -1 '/Applications' | grep 'Xcode_.*\.app' | sort -r | head -1)
|
|
sudo xcode-select -s "/Applications/$xcode_path"
|
|
else
|
|
echo "Not found."
|
|
fi
|
|
which clang
|
|
clang -v
|