From c15f022a41f2fdedab4325dd0631fbab507ed5e7 Mon Sep 17 00:00:00 2001 From: Jorge Antonio Diaz-Benito Soriano Date: Mon, 15 Apr 2024 17:12:28 +0200 Subject: [PATCH] Build on each XCode version available on the runner --- .github/workflows/build.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 373ac8fc..47973459 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,10 +4,36 @@ on: branches: - '**' jobs: - root: + generate-build-matrix: runs-on: macos-14-xlarge + outputs: + versions: ${{ steps.generate.outputs.versions }} + steps: + - id: generate + run: | + pair_list=() + for XCODE_INSTALL in $(ls /Applications | grep Xcode); do + /usr/libexec/PlistBuddy -c "print CFBundleShortVersionString" /Applications/$XCODE_INSTALL/Contents/Info.plist + pair_list+=$(/usr/libexec/PlistBuddy -c "print CFBundleShortVersionString" /Applications/$XCODE_INSTALL/Contents/Info.plist) + done + jsonString="$(jq -c --null-input '$ARGS.positional' --args -- "${pair_list[@]}")" + echo $pair_list + echo $jsonString + echo "versions=$jsonString" >> $GITHUB_OUTPUT + build: + runs-on: macos-14-xlarge + needs: [ generate-build-matrix ] + strategy: + matrix: + version: ${{ fromJSON(needs.generate-build-matrix.outputs.versions) }} steps: - uses: actions/checkout@v3.5.3 + - run: xcode-select -s ${{ matrix.version }} - uses: ./.github/actions/runGradleTask with: task: build + barrier-build: + runs-on: ubuntu-22.04 + needs: [ build ] + steps: + - run: exit 0