Skip to content

Commit

Permalink
Update release packaging for XCode 15 final
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoyne committed Sep 19, 2023
1 parent ecee9c5 commit 8ee4c1c
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 51 deletions.
20 changes: 10 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
x.y.z Release notes (yyyy-MM-dd)
10.42.3 Release notes (2023-09-18)
=============================================================

### Enhancements
* None.

* Update packaging for the Xcode 15.0 release. Carthage release and obj-c
binaries are now built with Xcode 15.

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-swift/issues/????), since v?.?.?)
* None.

<!-- ### Breaking Changes - ONLY INCLUDE FOR NEW MAJOR version -->
* The prebuilt Realm.xcframework for SPM was packaged incorrectly and did not
work ([#8361](https://github.com/realm/realm-swift/issues/8361), since v10.42.1).

### Compatibility

* Realm Studio: 14.0.1 or later.
* APIs are backwards compatible with all previous releases in the 10.x.y series.
* Carthage release for Swift is built with Xcode 14.3.1.
* Carthage release for Swift is built with Xcode 15.0.0.
* CocoaPods: 1.10 or later.
* Xcode: 14.1-15 beta 7.

### Internal
* Upgraded realm-core from ? to ?
* Xcode: 14.1-15.0.0.

10.42.2 Release notes (2023-09-13)
=============================================================
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile.publish
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pipeline {
agent { label 'osx' }
steps {
prepareWorkspace()
withCredentials([file(credentialsId: 's3cfg', variable: 'S3CMD_CONFIG')]) {
withCredentials([file(credentialsId: 'c0cc8f9e-c3f1-4e22-b22f-6568392e26ae', variable: 'S3CMD_CONFIG')]) {
sh './build.sh publish-update-checker'
}
}
Expand Down
30 changes: 17 additions & 13 deletions Jenkinsfile.releasability
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
xcodeVersions = ['14.1', '14.2', '14.3.1']
platforms = ['osx', 'ios', 'watchos', 'tvos', 'catalyst']
platformNames = ['osx': 'macOS', 'ios': 'iOS', 'watchos': 'watchOS', 'tvos': 'tvOS', 'catalyst': 'Catalyst', 'visionos': 'visionOS']
carthageXcodeVersion = '14.3.1'
carthageXcodeVersion = '15.0'
// This should be the same as carthageXcodeVersion, but we only have one Xcode 15 runner
docsXcodeVersion = '14.3.1'

def buildPlatform(platform, xcodeVersion, nodeLabel = 'osx') {
def buildPlatform(platform, xcodeVersion, xcodeSuffix, nodeLabel = 'osx') {
def platformName = platformNames[platform]
return {
node(nodeLabel) {
deleteDir()
unstash 'source'
sh "REALM_XCODE_VERSION=${xcodeVersion} ./build.sh package ${platform}"
withEnv(["DEVELOPER_DIR=/Applications/Xcode-${xcodeSuffix}.app/Contents/Developer"]) {
sh "./build.sh package ${platform}"
}
dir("build") {
stash includes: "realm-${platform}-${xcodeVersion}.zip",
name: "${platform}-${xcodeVersion}"
Expand All @@ -31,7 +35,7 @@ def installationTest(platform, test, xcode, language = 'swift', linkage = 'dynam

sh """
hostname
export REALM_XCODE_VERSION='${xcode}'
export DEVELOPER_DIR='/Applications/Xcode-${xcode}.app/Contents/Developer'
export REALM_TEST_BRANCH='${sha}'
cd examples/installation
./build.rb ${platform} ${test} ${linkage}
Expand Down Expand Up @@ -84,7 +88,7 @@ def doBuild() {
unstash 'source'
sh """
hostname
export REALM_XCODE_VERSION=${carthageXcodeVersion}
export REALM_XCODE_VERSION=${docsXcodeVersion}
sh build.sh package-docs
"""
dir('docs') {
Expand Down Expand Up @@ -116,11 +120,11 @@ def doBuild() {
def platform = p
def platformName = platformNames[platform]
for (def xcodeVersion in xcodeVersions) {
parallelBuilds["${platformName} ${xcodeVersion}"] = buildPlatform(platform, xcodeVersion)
parallelBuilds["${platformName} ${xcodeVersion}"] = buildPlatform(platform, xcodeVersion, xcodeVersion)
}
parallelBuilds["${platformName} 15.0"] = buildPlatform(platform, '15.0', 'macos_13')
parallelBuilds["${platformName} 15.0"] = buildPlatform(platform, '15.0', '15.0.0', 'macos_13')
}
parallelBuilds["visionOS 15.0"] = buildPlatform('visionos', '15.0', 'macos_13')
parallelBuilds["visionOS 15.0"] = buildPlatform('visionos', '15.0', '15-beta', 'macos_13')

parallel parallelBuilds
}
Expand All @@ -140,7 +144,7 @@ def doBuild() {
unstash 'examples'
unstash 'build-scripts'

withEnv(['REALM_XCODE_VERSION=15.0']) {
withEnv(['DEVELOPER_DIR=/Applications/Xcode-15-beta.app/Contents/Developer']) {
sh './build.sh package-release'
}

Expand Down Expand Up @@ -196,13 +200,13 @@ def doBuild() {
def platformName = platformNames[platform]
for (def test in ['xcframework', 'cocoapods', 'carthage', 'spm']) {
if (platform != 'catalyst' || test != 'carthage') {
parallelBuilds["Installation - ${platformName} ${test}"] = installationTest(platform, test, carthageXcodeVersion)
parallelBuilds["Installation - ${platformName} ${test}"] = installationTest(platform, test, docsXcodeVersion)
}
}
parallelBuilds["Installation - ${platformName} CocoaPods static"] = installationTest(platform, 'cocoapods', carthageXcodeVersion, 'swift', 'static')
parallelBuilds["Installation - ${platformName} spm static"] = installationTest(platform, 'spm', carthageXcodeVersion, 'swift', 'static')
parallelBuilds["Installation - ${platformName} CocoaPods static"] = installationTest(platform, 'cocoapods', docsXcodeVersion, 'swift', 'static')
parallelBuilds["Installation - ${platformName} spm static"] = installationTest(platform, 'spm', docsXcodeVersion, 'swift', 'static')
}
parallelBuilds['Installation - iOS Static'] = installationTest('ios', 'xcframework', carthageXcodeVersion, 'objc', 'static')
parallelBuilds['Installation - iOS Static'] = installationTest('ios', 'xcframework', docsXcodeVersion, 'objc', 'static')
parallelBuilds['Installation - XCFramework Evolution'] = xcframeworkEvolutionTest()
for (def version in xcodeVersions) {
parallelBuilds["Installation - Xcode ${version}"] = installationTest('osx', 'xcframework', version)
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PackageDescription
import Foundation

let coreVersion = Version("13.20.1")
let cocoaVersion = Version("10.42.2")
let cocoaVersion = Version("10.42.3")

let cxxSettings: [CXXSetting] = [
.headerSearchPath("."),
Expand Down
4 changes: 2 additions & 2 deletions Realm/Realm-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>10.42.2</string>
<string>10.42.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>10.42.2</string>
<string>10.42.3</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2014-2021 Realm. All rights reserved.</string>
<key>NSPrincipalClass</key>
Expand Down
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,12 @@ case "$COMMAND" in
;;

"test-ios")
xctest Realm -configuration "$CONFIGURATION" -sdk iphonesimulator -destination 'name=iPhone 8'
xctest Realm -configuration "$CONFIGURATION" -sdk iphonesimulator -destination 'name=iPhone 11'
exit 0
;;

"test-ios-swift")
xctest RealmSwift -configuration "$CONFIGURATION" -sdk iphonesimulator -destination 'name=iPhone 8'
xctest RealmSwift -configuration "$CONFIGURATION" -sdk iphonesimulator -destination 'name=iPhone 11'
exit 0
;;

Expand Down Expand Up @@ -592,7 +592,7 @@ case "$COMMAND" in
;;

"test-swiftui-ios")
xctest 'SwiftUITestHost' -configuration "$CONFIGURATION" -sdk iphonesimulator -destination 'name=iPhone 8'
xctest 'SwiftUITestHost' -configuration "$CONFIGURATION" -sdk iphonesimulator -destination 'name=iPhone 11'
exit 0
;;

Expand Down Expand Up @@ -1179,9 +1179,9 @@ x.y.z Release notes (yyyy-MM-dd)
### Compatibility
* Realm Studio: 14.0.1 or later.
* APIs are backwards compatible with all previous releases in the 10.x.y series.
* Carthage release for Swift is built with Xcode 14.3.1.
* Carthage release for Swift is built with Xcode 15.0.0.
* CocoaPods: 1.10 or later.
* Xcode: 14.1-15 beta 7.
* Xcode: 14.1-15.0.0.
### Internal
* Upgraded realm-core from ? to ?
Expand Down
2 changes: 1 addition & 1 deletion dependencies.list
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION=10.42.2
VERSION=10.42.3
REALM_CORE_VERSION=13.20.1
STITCH_VERSION=1eb31b87154cf7af6cbe50ab2732e2856ca499c7
25 changes: 10 additions & 15 deletions scripts/create-release-package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ def create_xcframework(root, xcode_version, configuration, name)
output = "#{prefix}/#{configuration}/#{name}.xcframework"
files = Dir.glob "#{prefix}/#{configuration}/*/#{name}.xcframework/*/#{name}.framework"

# We only ship a single Realm.xcframework built with the latest non-beta version of Xcode.
# Until Xcode 15 leaves beta, that means we need to stick a visionos slice
# built with Xcode 15 into an otherwise Xcode 14 xcframework.
if name == 'Realm' and xcode_version.start_with? '14' and XCODE_VERSIONS.include? '15.0'
files += Dir.glob "#{root}/15.0/#{configuration}/visionos/#{name}.xcframework/*/#{name}.framework"
end

sh 'xcodebuild', '-create-xcframework', '-allow-internal-distribution',
'-output', output, *files.flat_map {|f| ['-framework', f]}
end
Expand Down Expand Up @@ -74,9 +67,9 @@ def zip(name, *files)
end

puts 'Creating Obj-C XCFrameworks'
xcode_14_version = XCODE_VERSIONS.filter {|v| v.start_with? '14'}.last
create_xcframework tmp, xcode_14_version, 'Release', 'Realm'
create_xcframework tmp, xcode_14_version, 'Static', 'Realm'
objc_xcode_version = XCODE_VERSIONS.last
create_xcframework tmp, objc_xcode_version, 'Release', 'Realm'
create_xcframework tmp, objc_xcode_version, 'Static', 'Realm'

puts 'Creating release package'
package_dir = "#{tmp}/realm-swift-#{VERSION}"
Expand All @@ -95,9 +88,9 @@ def zip(name, *files)
</plist>
}
end
sh 'cp', '-Rca', "#{tmp}/#{xcode_14_version}/Release/Realm.xcframework", "#{package_dir}"
sh 'cp', '-Rca', "#{tmp}/#{objc_xcode_version}/Release/Realm.xcframework", "#{package_dir}"
FileUtils.mkdir_p "#{package_dir}/static"
sh 'cp', '-Rca', "#{tmp}/#{xcode_14_version}/Static/Realm.xcframework", "#{package_dir}/static"
sh 'cp', '-Rca', "#{tmp}/#{objc_xcode_version}/Static/Realm.xcframework", "#{package_dir}/static"
for version in XCODE_VERSIONS
FileUtils.mkdir_p "#{package_dir}/#{version}"
sh 'cp', '-Rca', "#{tmp}/#{version}/Release/RealmSwift.xcframework", "#{package_dir}/#{version}"
Expand All @@ -108,7 +101,9 @@ def zip(name, *files)
end

puts 'Creating SPM release zips'
zip 'Realm.spm.zip', "#{tmp}/#{xcode_14_version}/Release/Realm.xcframework"
Dir.chdir "#{tmp}/#{objc_xcode_version}/Release" do
zip 'Realm.spm.zip', "Realm.xcframework"
end
for version in XCODE_VERSIONS
Dir.chdir "#{tmp}/#{version}/Release" do
zip "RealmSwift@#{version}.spm.zip", 'RealmSwift.xcframework'
Expand All @@ -118,8 +113,8 @@ def zip(name, *files)
puts 'Creating Carthage release zip'
Dir.mktmpdir do |tmp2|
Dir.chdir(tmp2) do
sh 'cp', '-Rca', "#{tmp}/#{xcode_14_version}/Release/Realm.xcframework", tmp2
sh 'cp', '-Rca', "#{tmp}/#{xcode_14_version}/Release/RealmSwift.xcframework", tmp2
sh 'cp', '-Rca', "#{tmp}/#{objc_xcode_version}/Release/Realm.xcframework", tmp2
sh 'cp', '-Rca', "#{tmp}/#{objc_xcode_version}/Release/RealmSwift.xcframework", tmp2
zip 'Carthage.xcframework.zip', 'Realm.xcframework', 'RealmSwift.xcframework'
end
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/package_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def replace_framework(example, framework, path)
"examples/tvos/swift",
]

xcode_versions = %w(14.1 14.2 14.3.1)
xcode_versions = %w(14.1 14.2 14.3.1 15.0)

# Remove reference to Realm.xcodeproj from all example workspaces.
base_examples.each do |example|
Expand Down
4 changes: 2 additions & 2 deletions scripts/reset-simulators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ def shutdown_simulator_devices(devices)
print 'Booting Apple TV simulator...'
system("xcrun simctl boot 'Apple TV'") or raise "Failed to boot Apple TV simulator"
else
print 'Booting iPhone 8 simulator...'
system("xcrun simctl boot 'iPhone 8'") or raise "Failed to boot iPhone 8 simulator"
print 'Booting iPhone 11 simulator...'
system("xcrun simctl boot 'iPhone 11'") or raise "Failed to boot iPhone 11 simulator"
end
puts ' done!'

Expand Down

0 comments on commit 8ee4c1c

Please sign in to comment.