Skip to content

Commit

Permalink
Build tvOS wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
fealebenpae committed Jan 12, 2023
1 parent d8aa322 commit dea6691
Show file tree
Hide file tree
Showing 12 changed files with 251 additions and 102 deletions.
9 changes: 5 additions & 4 deletions .github/templates/common.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#@ androidABIs = [ 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' ]
#@ windowsArchs = [ 'Win32', 'x64', 'ARM64' ]
#@ windowsUWPArchs = [ 'Win32', 'x64', 'ARM', 'ARM64' ]
#@ iOSArchs = [ 'Simulator', 'Device', 'Catalyst' ]
#@ applePlatforms = [ 'iOS', 'tvOS' ]

#@ actionDockerLayerCaching = "satackey/action-docker-layer-caching@cc3f3828e75cbb45f0cf5139b95329c88480aa97" #! 0.0.11
#@ actionDockerBuild = "docker/build-push-action@6e95f19fb8c9e00a1a391941edbc0ae30c1799f7" #! 2.7.0
Expand Down Expand Up @@ -145,9 +145,10 @@ with:
#@ end

#@ def getWrapperBinaryNames():
#@ wrapperPlatforms = [ 'macos', 'linux' ]
#@ for iOSArch in iOSArchs:
#@ wrapperPlatforms.append("ios-" + iOSArch)
#@ wrapperPlatforms = [ 'macos', 'catalyst', 'linux' ]
#@ for platform in applePlatforms:
#@ wrapperPlatforms.append("apple-" + platform + "-Device")
#@ wrapperPlatforms.append("apple-" + platform + "-Simulator")
#@ end
#@ for androidABI in androidABIs:
#@ wrapperPlatforms.append("android-" + androidABI)
Expand Down
17 changes: 11 additions & 6 deletions .github/templates/wrappers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#@ load("@ytt:template", "template")
#@ load("common.lib.yml", "configuration", "checkoutCode", "actionCache", "actionDownloadArtifact", "getWrapperBinaryNames", "androidABIs", "windowsArchs", "windowsUWPArchs", "iOSArchs", "actionDockerLayerCaching", "actionDockerBuild", "actionDockerRun", "uploadArtifacts", "setupXcode")
#@ load("common.lib.yml", "configuration", "checkoutCode", "actionCache", "actionDownloadArtifact", "getWrapperBinaryNames", "androidABIs", "windowsArchs", "windowsUWPArchs", "applePlatforms", "actionDockerLayerCaching", "actionDockerBuild", "actionDockerRun", "uploadArtifacts", "setupXcode")

#@ wrappersTimeout = 90
#@ wrappersCacheCondition = "steps.check-cache.outputs.cache-hit != 'true'"
Expand Down Expand Up @@ -86,15 +86,20 @@ jobs:
runs-on: macos-12
name: macOS
_: #@ template.replace(buildWrappers("./wrappers/build-macos.sh", "wrappers-macos"))
ios:
catalyst:
runs-on: macos-12
name: iOS
name: Catalyst
_: #@ template.replace(buildWrappers("pwsh ./wrappers/build-apple-platform.ps1 Catalyst", "wrappers-catalyst"))
apple-platforms:
runs-on: macos-12
name: Apple Platform
strategy:
matrix:
arch: #@ iOSArchs
_: #@ template.replace(buildWrappers("pwsh ./wrappers/build-ios.ps1 ${{ matrix.arch }}", "wrappers-ios-${{ matrix.arch }}", enableLto = False, intermediateSteps = [setupXcode()]))
platform: #@ applePlatforms
target: [ 'Device', 'Simulator' ]
_: #@ template.replace(buildWrappers("pwsh ./wrappers/build-apple-platform.ps1 ${{ matrix.platform }} -Targets ${{ matrix.target }}", "wrappers-apple-${{ matrix.platform }}-${{ matrix.target }}", enableLto = False, intermediateSteps = [setupXcode()]))
#@yaml/map-key-override
if: #@ " || ".join([ "needs.check-cache.outputs.wrappers-ios-" + x + " != 'true'" for x in iOSArchs ])
if: #@ " || ".join([ "needs.check-cache.outputs.wrappers-apple-" + x + "-Device != 'true'" for x in applePlatforms ])
linux:
runs-on: ubuntu-latest
name: Linux
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,35 @@ jobs:
with:
name: wrappers-macos
path: wrappers/build
- name: Fetch artifacts for catalyst
uses: actions/download-artifact@v3
with:
name: wrappers-catalyst
path: wrappers/build
- name: Fetch artifacts for linux
uses: actions/download-artifact@v3
with:
name: wrappers-linux
path: wrappers/build
- name: Fetch artifacts for ios-Simulator
- name: Fetch artifacts for apple-iOS-Device
uses: actions/download-artifact@v3
with:
name: wrappers-apple-iOS-Device
path: wrappers/build
- name: Fetch artifacts for apple-iOS-Simulator
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Simulator
name: wrappers-apple-iOS-Simulator
path: wrappers/build
- name: Fetch artifacts for ios-Device
- name: Fetch artifacts for apple-tvOS-Device
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Device
name: wrappers-apple-tvOS-Device
path: wrappers/build
- name: Fetch artifacts for ios-Catalyst
- name: Fetch artifacts for apple-tvOS-Simulator
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Catalyst
name: wrappers-apple-tvOS-Simulator
path: wrappers/build
- name: Fetch artifacts for android-armeabi-v7a
uses: actions/download-artifact@v3
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/test-code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,35 @@ jobs:
with:
name: wrappers-macos
path: wrappers/build
- name: Fetch artifacts for catalyst
uses: actions/download-artifact@v3
with:
name: wrappers-catalyst
path: wrappers/build
- name: Fetch artifacts for linux
uses: actions/download-artifact@v3
with:
name: wrappers-linux
path: wrappers/build
- name: Fetch artifacts for ios-Simulator
- name: Fetch artifacts for apple-iOS-Device
uses: actions/download-artifact@v3
with:
name: wrappers-apple-iOS-Device
path: wrappers/build
- name: Fetch artifacts for apple-iOS-Simulator
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Simulator
name: wrappers-apple-iOS-Simulator
path: wrappers/build
- name: Fetch artifacts for ios-Device
- name: Fetch artifacts for apple-tvOS-Device
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Device
name: wrappers-apple-tvOS-Device
path: wrappers/build
- name: Fetch artifacts for ios-Catalyst
- name: Fetch artifacts for apple-tvOS-Simulator
uses: actions/download-artifact@v3
with:
name: wrappers-ios-Catalyst
name: wrappers-apple-tvOS-Simulator
path: wrappers/build
- name: Fetch artifacts for android-armeabi-v7a
uses: actions/download-artifact@v3
Expand Down
129 changes: 98 additions & 31 deletions .github/workflows/wrappers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ jobs:
CACHE_SKIP_SAVE: true
outputs:
wrappers-macos: ${{ steps.check-cache-macos.outputs.cache-hit }}
wrappers-catalyst: ${{ steps.check-cache-catalyst.outputs.cache-hit }}
wrappers-linux: ${{ steps.check-cache-linux.outputs.cache-hit }}
wrappers-ios-Simulator: ${{ steps.check-cache-ios-Simulator.outputs.cache-hit }}
wrappers-ios-Device: ${{ steps.check-cache-ios-Device.outputs.cache-hit }}
wrappers-ios-Catalyst: ${{ steps.check-cache-ios-Catalyst.outputs.cache-hit }}
wrappers-apple-iOS-Device: ${{ steps.check-cache-apple-iOS-Device.outputs.cache-hit }}
wrappers-apple-iOS-Simulator: ${{ steps.check-cache-apple-iOS-Simulator.outputs.cache-hit }}
wrappers-apple-tvOS-Device: ${{ steps.check-cache-apple-tvOS-Device.outputs.cache-hit }}
wrappers-apple-tvOS-Simulator: ${{ steps.check-cache-apple-tvOS-Simulator.outputs.cache-hit }}
wrappers-android-armeabi-v7a: ${{ steps.check-cache-android-armeabi-v7a.outputs.cache-hit }}
wrappers-android-arm64-v8a: ${{ steps.check-cache-android-arm64-v8a.outputs.cache-hit }}
wrappers-android-x86: ${{ steps.check-cache-android-x86.outputs.cache-hit }}
Expand Down Expand Up @@ -55,6 +57,23 @@ jobs:
if: matrix.os == 'ubuntu' && steps.check-cache-macos.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for catalyst
id: check-cache-catalyst
uses: nirinchev/cache@29e8e4dd9148ea81f9e188480132072cb6cc92d8
with:
path: ./wrappers/build/**
key: wrappers-catalyst-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-catalyst
uses: actions/upload-artifact@v3
with:
name: wrappers-catalyst
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if-no-files-found: error
if: matrix.os == 'ubuntu' && steps.check-cache-catalyst.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for linux
id: check-cache-linux
uses: nirinchev/cache@29e8e4dd9148ea81f9e188480132072cb6cc92d8
Expand All @@ -72,55 +91,72 @@ jobs:
if: matrix.os == 'ubuntu' && steps.check-cache-linux.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for ios-Simulator
id: check-cache-ios-Simulator
- name: Check cache for apple-iOS-Device
id: check-cache-apple-iOS-Device
uses: nirinchev/cache@29e8e4dd9148ea81f9e188480132072cb6cc92d8
with:
path: ./wrappers/build/**
key: wrappers-apple-iOS-Device-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-apple-iOS-Device
uses: actions/upload-artifact@v3
with:
name: wrappers-apple-iOS-Device
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if-no-files-found: error
if: matrix.os == 'ubuntu' && steps.check-cache-apple-iOS-Device.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for apple-iOS-Simulator
id: check-cache-apple-iOS-Simulator
uses: nirinchev/cache@29e8e4dd9148ea81f9e188480132072cb6cc92d8
with:
path: ./wrappers/build/**
key: wrappers-ios-Simulator-Release-${{hashFiles('./wrappers/**')}}
key: wrappers-apple-iOS-Simulator-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-ios-Simulator
- name: Store artifacts for wrappers-apple-iOS-Simulator
uses: actions/upload-artifact@v3
with:
name: wrappers-ios-Simulator
name: wrappers-apple-iOS-Simulator
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if-no-files-found: error
if: matrix.os == 'ubuntu' && steps.check-cache-ios-Simulator.outputs.cache-hit == 'true'
if: matrix.os == 'ubuntu' && steps.check-cache-apple-iOS-Simulator.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for ios-Device
id: check-cache-ios-Device
- name: Check cache for apple-tvOS-Device
id: check-cache-apple-tvOS-Device
uses: nirinchev/cache@29e8e4dd9148ea81f9e188480132072cb6cc92d8
with:
path: ./wrappers/build/**
key: wrappers-ios-Device-Release-${{hashFiles('./wrappers/**')}}
key: wrappers-apple-tvOS-Device-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-ios-Device
- name: Store artifacts for wrappers-apple-tvOS-Device
uses: actions/upload-artifact@v3
with:
name: wrappers-ios-Device
name: wrappers-apple-tvOS-Device
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if-no-files-found: error
if: matrix.os == 'ubuntu' && steps.check-cache-ios-Device.outputs.cache-hit == 'true'
if: matrix.os == 'ubuntu' && steps.check-cache-apple-tvOS-Device.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for ios-Catalyst
id: check-cache-ios-Catalyst
- name: Check cache for apple-tvOS-Simulator
id: check-cache-apple-tvOS-Simulator
uses: nirinchev/cache@29e8e4dd9148ea81f9e188480132072cb6cc92d8
with:
path: ./wrappers/build/**
key: wrappers-ios-Catalyst-Release-${{hashFiles('./wrappers/**')}}
key: wrappers-apple-tvOS-Simulator-Release-${{hashFiles('./wrappers/**')}}
if: matrix.os == 'ubuntu'
- name: Store artifacts for wrappers-ios-Catalyst
- name: Store artifacts for wrappers-apple-tvOS-Simulator
uses: actions/upload-artifact@v3
with:
name: wrappers-ios-Catalyst
name: wrappers-apple-tvOS-Simulator
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if-no-files-found: error
if: matrix.os == 'ubuntu' && steps.check-cache-ios-Catalyst.outputs.cache-hit == 'true'
if: matrix.os == 'ubuntu' && steps.check-cache-apple-tvOS-Simulator.outputs.cache-hit == 'true'
- run: git clean -fdx
if: matrix.os == 'ubuntu'
- name: Check cache for android-armeabi-v7a
Expand Down Expand Up @@ -339,15 +375,46 @@ jobs:
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if-no-files-found: error
ios:
catalyst:
runs-on: macos-12
name: iOS
name: Catalyst
timeout-minutes: 90
needs:
- check-cache
if: needs.check-cache.outputs.wrappers-catalyst != 'true'
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- name: Check cache
id: check-cache
uses: nirinchev/cache@29e8e4dd9148ea81f9e188480132072cb6cc92d8
with:
path: ./wrappers/build/**
key: wrappers-catalyst-Release-${{hashFiles('./wrappers/**')}}
- name: Build wrappers
run: pwsh ./wrappers/build-apple-platform.ps1 Catalyst -Configuration Release -EnableLTO
if: steps.check-cache.outputs.cache-hit != 'true'
- name: Store artifacts for wrappers-catalyst
uses: actions/upload-artifact@v3
with:
name: wrappers-catalyst
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if-no-files-found: error
apple-platforms:
runs-on: macos-12
name: Apple Platform
strategy:
matrix:
arch:
- Simulator
platform:
- iOS
- tvOS
target:
- Device
- Catalyst
- Simulator
timeout-minutes: 90
needs:
- check-cache
Expand All @@ -362,22 +429,22 @@ jobs:
uses: nirinchev/cache@29e8e4dd9148ea81f9e188480132072cb6cc92d8
with:
path: ./wrappers/build/**
key: wrappers-ios-${{ matrix.arch }}-Release-${{hashFiles('./wrappers/**')}}
key: wrappers-apple-${{ matrix.platform }}-${{ matrix.target }}-Release-${{hashFiles('./wrappers/**')}}
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@9a697e2b393340c3cacd97468baa318e4c883d98
with:
xcode-version: 14.0.1
- name: Build wrappers
run: pwsh ./wrappers/build-ios.ps1 ${{ matrix.arch }} -Configuration Release
run: pwsh ./wrappers/build-apple-platform.ps1 ${{ matrix.platform }} -Targets ${{ matrix.target }} -Configuration Release
if: steps.check-cache.outputs.cache-hit != 'true'
- name: Store artifacts for wrappers-ios-${{ matrix.arch }}
- name: Store artifacts for wrappers-apple-${{ matrix.platform }}-${{ matrix.target }}
uses: actions/upload-artifact@v3
with:
name: wrappers-ios-${{ matrix.arch }}
name: wrappers-apple-${{ matrix.platform }}-${{ matrix.target }}
path: ${{ github.workspace }}/wrappers/build/**
retention-days: 1
if-no-files-found: error
if: needs.check-cache.outputs.wrappers-ios-Simulator != 'true' || needs.check-cache.outputs.wrappers-ios-Device != 'true' || needs.check-cache.outputs.wrappers-ios-Catalyst != 'true'
if: needs.check-cache.outputs.wrappers-apple-iOS-Device != 'true' || needs.check-cache.outputs.wrappers-apple-tvOS-Device != 'true'
linux:
runs-on: ubuntu-latest
name: Linux
Expand Down
16 changes: 16 additions & 0 deletions Realm/Realm/Realm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,22 @@
<PackagePath>runtimes\maccatalyst\native\realm-wrappers.framework.zip</PackagePath>
<Link>wrappers\macosx\realm-wrappers.framework.zip</Link>
</None>
<!-- tvOS -->
<Content Include="wrappers-props\xamarintvos\Realm.dll.config">
<Pack>true</Pack>
<PackagePath>build\xamarintvos\</PackagePath>
</Content>
<Content Include="wrappers-props\xamarintvos\wrappers.props" Pack="true" PackagePath="build\xamarintvos\Realm.props" />
<None Include="..\..\wrappers\build\appletvos\$(Configuration)\realm-wrappers.framework\**">
<Pack>true</Pack>
<PackagePath>runtimes\tvos\native\realm-wrappers.framework</PackagePath>
<Link>wrappers\appletvos\realm-wrappers.framework\%(RecursiveDir)%(Filename)%(Extension)</Link>
</None>
<None Include="..\..\wrappers\build\appletvsimulator\$(Configuration)\realm-wrappers.framework\**">
<Pack>true</Pack>
<PackagePath>runtimes\tvossimulator\native\realm-wrappers.framework</PackagePath>
<Link>wrappers\appletvsimulator\realm-wrappers.framework\%(RecursiveDir)%(Filename)%(Extension)</Link>
</None>
<!-- macOS -->
<Content Include="wrappers-props\xamarinmac\wrappers.props" Pack="true" PackagePath="build\xamarinmac\Realm.props" />
<None Include="..\..\wrappers\build\Darwin\$(Configuration)\librealm-wrappers.dylib">
Expand Down
Loading

0 comments on commit dea6691

Please sign in to comment.