Skip to content

Commit 4dd814b

Browse files
authored
Merge pull request #1387 from ychin/fix-ci-wrong-xcode-version-packages
Fix CI not handling Xcode version correctly with packages
2 parents 462d89c + 86af12a commit 4dd814b

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.github/actions/universal-package/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ runs:
1111
using: 'composite'
1212
steps:
1313
- name: Set up formula
14+
id: setup-formula
1415
shell: bash
1516
run: |
1617
echo '::group::Set up formula'
@@ -23,14 +24,19 @@ runs:
2324
2425
# Uninstall the already installed formula because we want to build our own
2526
brew uninstall --ignore-dependencies ${formula} || true
27+
28+
# Extract Xcode version to serve as part of the key for caching
29+
xcode_version=$(xcodebuild -version | tail -1 | sed -E 's/Build version (.*)/\1/')
30+
echo "xcode_version=$xcode_version" >> $GITHUB_OUTPUT
31+
2632
echo '::endgroup::'
2733
2834
- name: Cache keg
2935
id: cache-keg
3036
uses: actions/cache@v3
3137
with:
3238
path: /usr/local/Cellar/${{ inputs.formula }}
33-
key: ${{ inputs.formula }}-homebrew-cache-patched-unified-${{ hashFiles(format('{0}.rb', inputs.formula)) }}
39+
key: ${{ inputs.formula }}-homebrew-cache-patched-unified-xcode${{ steps.setup-formula.outputs.xcode_version }}-${{ hashFiles(format('{0}.rb', inputs.formula)) }}
3440

3541
- name: Install formula
3642
shell: bash

.github/workflows/ci-macvim.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262

6363
# Most up to date OS and Xcode. Used to publish release for the main build.
6464
- os: macos-12
65-
xcode: '14.1'
65+
xcode: '14.2'
6666
publish: true
6767

6868
runs-on: ${{ matrix.os }}
@@ -82,6 +82,13 @@ jobs:
8282
# Later, we pass the --enable-sparkle_1 flag to configure to set the corresponding ifdef.
8383
ln -fhs Sparkle_1.framework src/MacVim/Sparkle.framework
8484
85+
- name: Set up Xcode
86+
if: matrix.xcode != ''
87+
run: |
88+
sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
89+
xcode-select -p
90+
xcodebuild -version
91+
8592
# Set up, install, and cache gettext library for localization.
8693
#
8794
# Instead of using the default binary installed by Homebrew, need to build our own because gettext is statically
@@ -131,12 +138,6 @@ jobs:
131138
brew unlink perl
132139
fi
133140
134-
- name: Set up Xcode
135-
if: matrix.xcode != ''
136-
run: |
137-
sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
138-
xcode-select -p
139-
140141
# All set up steps are done. Build and test MacVim below.
141142

142143
- name: Configure

0 commit comments

Comments
 (0)