Skip to content

Commit

Permalink
CI for macOS 13 (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
arielelkin authored Sep 13, 2024
1 parent 13bc881 commit 96f71b6
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 42 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/primary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ on:
jobs:
primary:
name: Primary
runs-on: macOS-11
runs-on: macOS-13
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_13.2.app
run: sudo xcode-select -s /Applications/Xcode_15.0.app

- name: Build demos
run: sh ci/build_demos.sh
Expand All @@ -33,44 +33,44 @@ jobs:

spm:
name: Swift Package Manager
runs-on: macOS-11
runs-on: macOS-13
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Swift Build
run: swift build

cocoapods:
name: Cocoapods
runs-on: macOS-11
runs-on: macOS-13
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Lint Podspec
run: pod lib lint
run: pod lib lint --allow-warnings

xcframework:
name: XCFramework
runs-on: macOS-11
runs-on: macOS-13
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Build XCFramework
run: ci/build_xcframework.sh

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: PocketSVG.xcframework
path: derived_data/xcframework/PocketSVG.xcframework
retention-days: 5

create-release:
name: Make release
runs-on: macOS-11
runs-on: macOS-13
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') # only if tag is pushed
needs: [primary, cocoapods, spm, xcframework]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: PocketSVG.xcframework
path: PocketSVG.xcframework
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ let package = Package(
products: [
.library(
name: "PocketSVG",
targets: ["PocketSVG"]
),
type: .dynamic,
targets: ["PocketSVG"])
],
dependencies: [
],
Expand Down
6 changes: 3 additions & 3 deletions ci/build_demos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -xeo pipefail
rm -rf .build/
rm -rf derived_data/

IOS_DESTINATION="platform=iOS Simulator,name=iPhone 11 Pro"
IOS_DESTINATION="platform=iOS Simulator,name=iPhone 15"

echo "Build iOS demo"
xcodebuild \
Expand All @@ -23,7 +23,7 @@ xcodebuild \
'OTHER_LDFLAGS=$(inherited) -lxml2' \
clean \
build \
| xcpretty
| xcbeautify

echo "Build macOS demo"
xcodebuild \
Expand All @@ -34,4 +34,4 @@ xcodebuild \
'OTHER_LDFLAGS=$(inherited) -lxml2' \
clean \
build \
| xcpretty
| xcbeautify
30 changes: 11 additions & 19 deletions ci/build_xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,57 @@
#!/usr/bin/env bash
set -xeo pipefail

PROJECT_PATH="derived_data/PocketSVG.xcodeproj"
IOS_SIMULATOR_XCARCHIVE_PATH="derived_data/archives/PocketSVG-iOS-Simulator.xcarchive"
IOS_DEVICE_XCARCHIVE_PATH="derived_data/archives/PocketSVG-iOS-Device.xcarchive"
MACOS_XCARCHIVE_PATH="derived_data/archives/PocketSVG-macOS.xcarchive"
TVOS_XCARCHIVE_PATH="derived_data/archives/PocketSVG-tvOS.xcarchive"
CATALYST_XCARCHIVE_PATH="derived_data/archives/PocketSVG-Catalyst.xcarchive"
XCFRAMEWORK_PATH="derived_data/xcframework/PocketSVG.xcframework"

swift package generate-xcodeproj --output $PROJECT_PATH

xcodebuild archive \
-project $PROJECT_PATH \
-scheme PocketSVG-Package \
-scheme PocketSVG \
-destination 'generic/platform=iOS' \
-derivedDataPath derived_data \
-archivePath $IOS_DEVICE_XCARCHIVE_PATH \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
| xcpretty
| xcbeautify

xcodebuild archive \
-project $PROJECT_PATH \
-scheme PocketSVG-Package \
-scheme PocketSVG \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath derived_data \
-archivePath $IOS_SIMULATOR_XCARCHIVE_PATH \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
| xcpretty
| xcbeautify

xcodebuild archive \
-project $PROJECT_PATH \
-scheme PocketSVG-Package \
-scheme PocketSVG \
-destination 'generic/platform=macOS' \
-derivedDataPath derived_data \
-archivePath $MACOS_XCARCHIVE_PATH \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
| xcpretty
| xcbeautify

xcodebuild archive \
-project $PROJECT_PATH \
-scheme PocketSVG-Package \
-destination 'generic/platform=tvos' \
-scheme PocketSVG \
-destination 'generic/platform=appletvos' \
-derivedDataPath derived_data \
-archivePath $TVOS_XCARCHIVE_PATH \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
| xcpretty
| xcbeautify

xcodebuild archive \
-project $PROJECT_PATH \
-scheme PocketSVG-Package \
-scheme PocketSVG \
-destination 'generic/platform=macOS,variant=Mac Catalyst' \
-derivedDataPath derived_data \
-archivePath $CATALYST_XCARCHIVE_PATH \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
| xcpretty
| xcbeautify

IOS_SIMULATOR_FRAMEWORK_PATH=$(find $IOS_SIMULATOR_XCARCHIVE_PATH -name "*.framework")
IOS_DEVICE_FRAMEWORK_PATH=$(find $IOS_DEVICE_XCARCHIVE_PATH -name "*.framework")
Expand Down
8 changes: 4 additions & 4 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ set -xeo pipefail

xcodebuild \
-scheme PocketSVG \
-destination "platform=iOS Simulator,name=iPhone 11 Pro" \
-destination "platform=iOS Simulator,name=iPhone 15" \
test \
| xcpretty
| xcbeautify

xcodebuild \
-scheme PocketSVG \
-destination "platform=iOS Simulator,name=iPhone 11 Pro" \
-destination "platform=iOS Simulator,name=iPhone 15" \
test \
| xcpretty
| xcbeautify

0 comments on commit 96f71b6

Please sign in to comment.