Skip to content

Commit

Permalink
Move Xcode 16 jobs to the macos-15 runner (#8695)
Browse files Browse the repository at this point in the history
Xcode 16 will be removed from macos-14 to cut down on the image size:
actions/runner-images#10703
  • Loading branch information
tgoyne authored Oct 22, 2024
1 parent 2f7bd40 commit 06a8f88
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 297 deletions.
149 changes: 57 additions & 92 deletions .github/workflows/master-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
- "master"
- "release/**"
env:
XCODE_VERSION: "['15.3', '15.4', '16', '16.1_beta_2']"
XCODE_VERSION: "['15.3', '15.4', '16', '16.1_beta_3']"
PLATFORM: "['ios', 'osx', 'watchos', 'tvos', 'catalyst', 'visionos']"
DOC_VERSION: '15.4'
RELEASE_VERSION: '15.4'
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
jobs:
prepare:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -38,8 +38,6 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Select Xcode Version
run: sudo xcode-select -switch /Applications/Xcode_${{ env.DOC_VERSION }}.app
- name: Prepare docs for packaging
run: bundle exec sh -x build.sh release-package-docs
- name: Upload docs to artifacts library
Expand All @@ -61,15 +59,27 @@ jobs:
name: realm-examples
path: realm-examples.zip
build-product: # Creates framework for each platform, xcode version, target and configuration
runs-on: macos-14
name: Package framework
needs: prepare
strategy:
max-parallel: 20 # Blocks of 20, therefore if any of the build fails, we don't get a lot of XCode Clouds builds hanging, which are expensive.
max-parallel: 20
matrix:
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }}
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
configuration: [swift, static]
include:
- xcode-version: 15.3
xcode-version-tag: 15.3
os: macos-14
- xcode-version: 15.4
xcode-version-tag: 15.4
os: macos-14
- xcode-version: 16
xcode-version-tag: '16.0'
os: macos-15
- xcode-version: 16.1_beta_3
xcode-version-tag: 16.1
os: macos-15
exclude:
- platform: osx
configuration: static
Expand All @@ -81,79 +91,39 @@ jobs:
configuration: static
- platform: catalyst
configuration: static
- platform: visionos
xcode-version: 15.1
runs-on: ${{ matrix.os }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{matrix.xcode-version}}.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- name: Build ${{ matrix.platform }} with Xcode ${{ matrix.xcode-version }}
run: DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer sh build.sh ${{ matrix.platform }}-${{matrix.configuration}}
- run: rm -r build/DerivedData
- name: Download visionOS
if: matrix.platform == 'visionos' && matrix.os == 'macos-14'
run: xcodebuild -downloadPlatform visionOS
- run: sh build.sh ${{matrix.platform}}-${{matrix.configuration}}
- run: tar cf build.tar build/*/${{matrix.platform}}
- name: Upload framework
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.platform }}-${{ matrix.xcode-version }}-${{ matrix.configuration }}
path: build
name: build-${{matrix.platform}}-${{matrix.xcode-version-tag}}-${{matrix.configuration}}
path: build.tar
compression-level: 1
package-xcframework-platform: # Creates xcframework for each platform and xcode version
runs-on: macos-14
name: Package xcframework for platform
needs: [build-product, prepare]
strategy:
matrix:
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }}
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
exclude:
- platform: visionos
xcode-version: 15.1
steps:
- uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
- name: Install the Apple certificate and provisioning profile
env:
DEVELOPMENT_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
sh -x build.sh install-apple-certificates
- name: Restore frameworks
uses: actions/download-artifact@v4
with:
pattern: build-${{ matrix.platform }}*-${{ matrix.xcode-version }}-*
- name: Create xcframework
env:
SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }}
run: |
sh -x build.sh release-create-xcframework-${{ matrix.xcode-version }} ${{ matrix.platform }}
- name: Upload xcframework
uses: actions/upload-artifact@v4
with:
name: realm-${{ matrix.platform }}-${{ matrix.xcode-version }}
path: realm-${{ matrix.platform }}-${{ matrix.xcode-version }}.zip
package-release: # Creates xcframework for each platform and xcode version
package-release:
runs-on: macos-14
name: Package release file
needs: [package-xcframework-platform, prepare]
needs: [build-product, prepare]
steps:
- uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
- uses: actions/download-artifact@v4
- name: Install the Apple certificate and provisioning profile
env:
DEVELOPMENT_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
sh -x build.sh install-apple-certificates
- name: Restore packages xcframeworks
uses: actions/download-artifact@v4
with:
pattern: realm-*
run: sh build.sh install-apple-certificates
- name: Create release
env:
SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }}
run: |
sh -x build.sh release-package
run: sh -x build.sh release-package
- name: Upload release artifactss
uses: actions/upload-artifact@v4
with:
Expand All @@ -162,20 +132,18 @@ jobs:
- name: Upload release for testing
uses: actions/upload-artifact@v4
with:
name: realm-swift-${{ needs.prepare.outputs.VERSION }}
name: test-release-package
path: pkg/realm-swift-${{ needs.prepare.outputs.VERSION }}.zip
test-package-examples:
runs-on: macos-14
name: Test examples
needs: [package-release, prepare]
steps:
- uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
- name: Restore release
uses: actions/download-artifact@v4
with:
name: realm-swift-${{ needs.prepare.outputs.VERSION }}
name: test-release-package
- name: Test examples
run: sh -x build.sh release-test-examples
test-ios-static:
Expand All @@ -184,8 +152,6 @@ jobs:
needs: package-release
steps:
- uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
- name: Test ios static
run: sh -x build.sh test-ios-static
test-osx-static:
Expand All @@ -194,8 +160,6 @@ jobs:
needs: package-release
steps:
- uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
- name: Test osx static
run: |
export REALM_DISABLE_METADATA_ENCRYPTION=1
Expand All @@ -204,19 +168,19 @@ jobs:
runs-on: macos-14
name: Run installation test
needs: [package-release, prepare]
env:
REALM_TEST_BRANCH: "${{github.ref_name}}"
strategy:
matrix:
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }}
installation: [cocoapods, spm, carthage, xcframework]
installation: [cocoapods, spm, carthage]
linkage: [dynamic, static]
exclude:
- platform: visionos
- platform: catalyst
installation: carthage
- installation: carthage
linkage: static
- installation: xcframework
linkage: static
include:
- platform: ios
installation: xcframework
Expand All @@ -226,50 +190,51 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Select Xcode Version
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app
- name: Download visionOS
if: matrix.platform == 'visionos' && matrix.os == 'macos-14'
run: xcodebuild -downloadPlatform visionOS
- name: Restore release
uses: actions/download-artifact@v4
if: ${{ matrix.installation == 'xcframework' }}
with:
name: realm-${{ matrix.platform }}-${{ env.RELEASE_VERSION }}
- name: Unzip package release
if: ${{ matrix.installation == 'xcframework' }}
run: |
mkdir -p build
unzip realm-${{ matrix.platform }}-${{ env.RELEASE_VERSION }}.zip -d build
name: test-release-package
- name: Run installation test
run: |
echo "REALM_TEST_BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
find . -name '*.zip' -depth 1 -exec mv {} examples/installation \;
cd examples/installation
bundle exec ./build.rb ${{ matrix.platform }} ${{ matrix.installation }} ${{ matrix.linkage }}
test-installation-xcframework:
runs-on: macos-14
name: Run installation test for xcframework
needs: [package-release, prepare]
env:
PLATFORM: 'osx'
strategy:
matrix:
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
include:
- xcode-version: 15.3
os: macos-14
- xcode-version: 15.4
os: macos-14
- xcode-version: 16
os: macos-15
- xcode-version: 16.1_beta_3
os: macos-15
env:
PLATFORM: 'osx'
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer
REALM_TEST_BRANCH: "${{github.ref_name}}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Select Xcode Version
run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode-version }}.app
- name: Restore release
uses: actions/download-artifact@v4
with:
name: realm-${{ env.PLATFORM }}-${{ matrix.xcode-version }}
- name: Unzip package release
run: |
mkdir -p build
unzip realm-${{ env.PLATFORM }}-${{ matrix.xcode-version }}.zip -d build
name: test-release-package
- name: Run installation test
run: |
echo "REALM_TEST_BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
find . -name '*.zip' -depth 1 -exec mv {} examples/installation \;
cd examples/installation
bundle exec ./build.rb osx xcframework dynamic
Loading

0 comments on commit 06a8f88

Please sign in to comment.