Skip to content

Commit

Permalink
Add support for visionOS, drop support for Swift 5.5 (#2152)
Browse files Browse the repository at this point in the history
  • Loading branch information
calda authored Sep 6, 2023
1 parent e7dc5c1 commit 4a9e46f
Show file tree
Hide file tree
Showing 19 changed files with 987 additions and 64 deletions.
105 changes: 93 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ jobs:
fail-fast: false
matrix:
xcode:
- '13.2.1' # Swift 5.5
- '13.4.1' # Swift 5.6
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
xcode: ${{ matrix.xcode }}
- name: Build Package
run: bundle exec rake build:package:all
run: SKIP_VISION_OS=true bundle exec rake build:package:all

build-package-macos-13:
name: "Build Package"
Expand All @@ -33,6 +32,22 @@ jobs:
xcode:
- '14.2' # Swift 5.7
- '14.3' # Swift 5.8
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
xcode: ${{ matrix.xcode }}
- name: Build Package
run: SKIP_VISION_OS=true bundle exec rake build:package:all

build-package-macos-13-xcode-15:
name: "Build Package"
runs-on: macos-13
strategy:
fail-fast: false
matrix:
xcode:
- '15.0' # Swift 5.9, first version that includes visionOS SDK.
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
Expand All @@ -48,7 +63,7 @@ jobs:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
xcode: '14.3' # Swift 5.8
xcode: '15.0' # Swift 5.9
- name: Build Example
run: bundle exec rake build:example:all

Expand Down Expand Up @@ -84,19 +99,49 @@ jobs:
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_TOKEN }}
PR_NUMBER: ${{ github.event.number }}

build-xcframework:
build-xcframework-macos-12:
name: "Build XCFramework"
runs-on: macos-12
strategy:
matrix:
xcode:
# XCFrameworks are forwards-compatible but not backwards-compatible.
# The Xcode version we use for this job is that oldest Xcode version that
# will be able to use these XCFrameworks and the lottie-spm package.
- '13.4.1' # Swift 5.6.1
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
# XCFrameworks are forwards-compatible but not backwards-compatible.
# The Xcode version we use for this job is that oldest Xcode version that
# will be able to use these XCFrameworks and the lottie-spm package.
xcode: '13.2.1' # Swift 5.5.2
xcode: ${{ matrix.xcode }}
- name: Build XCFramework
run: bundle exec rake build:xcframework
run: SKIP_VISION_OS=true bundle exec rake build:xcframework[Lottie-Xcode-${{ matrix.xcode }}]
- name: Upload XCFramework
uses: actions/upload-artifact@v2
with:
name: BuildProducts
# The xcframework is at the path `.build/archives/Lottie.xcframework.zip`.
# GitHub always zips the artifacts before uploading, so if we uploaded the .xframework.zip
# directly then it would actually upload a double-zip (a .zip containing our `Lottie.xcframework.zip`).
# This is confusing especially since macOS Archive Utility automatially unzips both layers at once.
# Instead, we upload the entire archives folder, resulting in an `XCFramework.zip` that unzips
# to an `archives` directory containing our `Lottie.xcframework.zip`.
path: .build/archives

build-xcframework-macos-13:
name: "Build XCFramework"
runs-on: macos-13
strategy:
matrix:
xcode:
- '15.0' # Swift 5.9, and the first Xcode version with the visionOS SDK.
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
xcode: ${{ matrix.xcode }}
- name: Build XCFramework
run: bundle exec rake build:xcframework[Lottie-Xcode-${{ matrix.xcode }}]
- name: Upload XCFramework
uses: actions/upload-artifact@v2
with:
Expand All @@ -117,21 +162,57 @@ jobs:
- uses: ./.github/actions/setup
with:
install-mint: false
xcode: '14.3' # Swift 5.8
- name: Lint CocoaPod Podspec
run: bundle exec rake lint:podspec

spm:
name: "Test Swift Package Manager support"
spm-xcode-15:
name: "Test Swift Package Manager"
runs-on: macos-13
strategy:
matrix:
xcode:
- '15.0' # Swift 5.9, first version with visionOS SDK.
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
install-mint: true
xcode: ${{ matrix.xcode }}
- name: Test Swift Package Manager support
run: bundle exec rake test:spm

spm-xcode-14:
name: "Test Swift Package Manager"
runs-on: macos-13
strategy:
matrix:
xcode:
- '14.3' # Swift 5.8
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
install-mint: true
xcode: ${{ matrix.xcode }}
- name: Test Swift Package Manager support
run: SKIP_VISION_OS=true bundle exec rake test:spm

spm-xcode-13:
name: "Test Swift Package Manager"
runs-on: macos-12
strategy:
matrix:
xcode:
- '13.4.1' # Swift 5.6
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
with:
install-mint: true
xcode: ${{ matrix.xcode }}
- name: Test Swift Package Manager support
run: SKIP_VISION_OS=true bundle exec rake test:spm

carthage:
name: "Test Carthage support"
runs-on: macos-13
Expand Down
10 changes: 5 additions & 5 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -217,13 +217,13 @@
PRODUCT_BUNDLE_IDENTIFIER = com.airbnb.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TARGETED_DEVICE_FAMILY = "1,2,3,7";
TVOS_DEPLOYMENT_TARGET = 16.0;
};
name = Debug;
Expand Down Expand Up @@ -266,12 +266,12 @@
PRODUCT_BUNDLE_IDENTIFIER = com.airbnb.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TARGETED_DEVICE_FAMILY = "1,2,3,7";
TVOS_DEPLOYMENT_TARGET = 16.0;
};
name = Release;
Expand Down
Loading

0 comments on commit 4a9e46f

Please sign in to comment.