5353 strategy :
5454 fail-fast : false
5555 matrix :
56- os : [win, osx, linux, ios, android]
56+ os : [win, osx, linux, ios, iossimulator, android]
5757 arch : [x86, x64, arm, arm64]
5858 include :
5959 - os : win
6464 runner : ubuntu-22.04
6565 - os : ios
6666 runner : macos-14
67+ - os : iossimulator
68+ runner : macos-14
6769 - os : android
6870 runner : ubuntu-22.04
6971 exclude :
8385 os : linux
8486 - arch : x86
8587 os : ios
88+ - arch : x64
89+ os : ios
90+ - arch : arm
91+ os : iossimulator
92+ - arch : x86
93+ os : iossimulator
94+ - arch : x64
95+ os : iossimulator
8696
8797 steps :
8898 - name : Checkout ${{ github.repository }}
@@ -104,6 +114,14 @@ jobs:
104114 run : Write-Output "IPHONEOS_DEPLOYMENT_TARGET=12.1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
105115 shell : pwsh
106116
117+ - name : Configure iOS simulator deployement target
118+ if : ${{ matrix.os == 'iossimulator' }}
119+ run : |
120+ Write-Output "IPHONESIMULATOR_DEPLOYMENT_TARGET=12.1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
121+ $SimulatorSdk = xcrun --sdk iphonesimulator --show-sdk-path
122+ Write-Output "SDKROOT=$SimulatorSdk" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
123+ shell : pwsh
124+
107125 - name : Update runner
108126 if : ${{ matrix.os == 'linux' }}
109127 run : sudo apt update
@@ -129,7 +147,7 @@ jobs:
129147 # No pre-generated bindings for Android and iOS.
130148 # https://aws.github.io/aws-lc-rs/platform_support.html#pre-generated-bindings
131149 - name : Install bindgen-cli for aws-lc-sys
132- if : ${{ matrix.os == 'android' || matrix.os == 'ios' }}
150+ if : ${{ matrix.os == 'android' || matrix.os == 'ios' || matrix.os == 'iossimulator' }}
133151 run : cargo install --force --locked bindgen-cli
134152
135153 # For aws-lc-sys. Error returned otherwise:
@@ -160,11 +178,11 @@ jobs:
160178 $RustArch = @{'x64'='x86_64';'arm64'='aarch64';
161179 'x86'='i686';'arm'='armv7'}[$DotNetArch]
162180 $RustPlatform = @{'win'='pc-windows-msvc';
163- 'osx'='apple-darwin';'ios'='apple-ios';
181+ 'osx'='apple-darwin';'ios'='apple-ios';'iossimulator'='apple-ios-sim';
164182 'linux'='unknown-linux-gnu';'android'='linux-android'}[$DotNetOs]
165- $LibPrefix = @{'win'='';'osx'='lib';'ios'='lib';
183+ $LibPrefix = @{'win'='';'osx'='lib';'ios'='lib';'iossimulator'='lib';
166184 'linux'='lib';'android'='lib'}[$DotNetOs]
167- $LibSuffix = @{'win'='.dll';'osx'='.dylib';'ios'='.dylib';
185+ $LibSuffix = @{'win'='.dll';'osx'='.dylib';'ios'='.dylib';'iossimulator'='.dylib';
168186 'linux'='.so';'android'='.so'}[$DotNetOs]
169187 $RustTarget = "$RustArch-$RustPlatform"
170188
@@ -211,52 +229,13 @@ jobs:
211229 Copy-Item $OutputLibrary $(Join-Path $OutputPath $RenamedLibraryName)
212230 shell : pwsh
213231
214- - name : Upload native components
215- uses : actions/upload-artifact@v7
216- with :
217- name : ironrdp-${{matrix.os}}-${{matrix.arch}}
218- path : dependencies/runtimes/${{matrix.os}}-${{matrix.arch}}
219-
220- build-universal :
221- name : Universal build
222- needs : [preflight, build-native]
223- runs-on : ubuntu-22.04
224- strategy :
225- fail-fast : false
226- matrix :
227- os : [ osx, ios ]
228-
229- steps :
230- - name : Checkout ${{ github.repository }}
231- uses : actions/checkout@v6
232-
233- - name : Setup CCTools
234- uses : Devolutions/actions-public/setup-cctools@v1
235-
236- - name : Download native components
237- uses : actions/download-artifact@v8
238- with :
239- path : dependencies/runtimes
240-
241- - name : Lipo native components
242- run : |
243- Set-Location "dependencies/runtimes"
244- # No RID for universal binaries, see: https://github.com/dotnet/runtime/issues/53156
245- $OutputPath = Join-Path "${{ matrix.os }}-universal" "native"
246- New-Item -ItemType Directory -Path $OutputPath | Out-Null
247- $Libraries = Get-ChildItem -Recurse -Path "ironrdp-${{ matrix.os }}-*" -Filter "*.dylib" | Foreach-Object { $_.FullName } | Select -Unique
248- $LipoCmd = $(@('lipo', '-create', '-output', (Join-Path -Path $OutputPath -ChildPath "libDevolutionsIronRdp.dylib")) + $Libraries) -Join ' '
249- Write-Host $LipoCmd
250- Invoke-Expression $LipoCmd
251- shell : pwsh
252-
253- - name : Framework
254- if : ${{ matrix.os == 'ios' }}
232+ - name : Framework (${{matrix.os}}-${{matrix.arch}})
233+ if : ${{ matrix.os == 'ios' || matrix.os == 'iossimulator' }}
255234 run : |
256235 $Version = '${{ needs.preflight.outputs.project-version }}'
257236 $ShortVersion = '${{ needs.preflight.outputs.package-version }}'
258237 $BundleName = "libDevolutionsIronRdp"
259- $RuntimesDir = Join-Path "dependencies" "runtimes" "ios-universal " "native"
238+ $RuntimesDir = Join-Path "dependencies" "runtimes" "${{ matrix.os }}-${{ matrix.arch }} " "native"
260239 $FrameworkDir = Join-Path "$RuntimesDir" "$BundleName.framework"
261240 New-Item -Path $FrameworkDir -ItemType "directory" -Force
262241 $FrameworkExecutable = Join-Path $FrameworkDir $BundleName
@@ -295,6 +274,45 @@ jobs:
295274 ((Get-Content -Path (Join-Path $FrameworkDir "Info.plist") -Raw) -Replace 'PropertyList-1.0.dtd"\[\]', 'PropertyList-1.0.dtd"') | Set-Content -Path (Join-Path $FrameworkDir "Info.plist")
296275 shell : pwsh
297276
277+ - name : Upload native components
278+ uses : actions/upload-artifact@v7
279+ with :
280+ name : ironrdp-${{matrix.os}}-${{matrix.arch}}
281+ path : dependencies/runtimes/${{matrix.os}}-${{matrix.arch}}
282+
283+ build-universal :
284+ name : Universal build
285+ needs : [preflight, build-native]
286+ runs-on : ubuntu-22.04
287+ strategy :
288+ fail-fast : false
289+ matrix :
290+ os : [ osx ]
291+
292+ steps :
293+ - name : Checkout ${{ github.repository }}
294+ uses : actions/checkout@v6
295+
296+ - name : Setup CCTools
297+ uses : Devolutions/actions-public/setup-cctools@v1
298+
299+ - name : Download native components
300+ uses : actions/download-artifact@v8
301+ with :
302+ path : dependencies/runtimes
303+
304+ - name : Lipo native components
305+ run : |
306+ Set-Location "dependencies/runtimes"
307+ # No RID for universal binaries, see: https://github.com/dotnet/runtime/issues/53156
308+ $OutputPath = Join-Path "${{ matrix.os }}-universal" "native"
309+ New-Item -ItemType Directory -Path $OutputPath | Out-Null
310+ $Libraries = Get-ChildItem -Recurse -Path "ironrdp-${{ matrix.os }}-*" -Filter "*.dylib" | Foreach-Object { $_.FullName } | Select -Unique
311+ $LipoCmd = $(@('lipo', '-create', '-output', (Join-Path -Path $OutputPath -ChildPath "libDevolutionsIronRdp.dylib")) + $Libraries) -Join ' '
312+ Write-Host $LipoCmd
313+ Invoke-Expression $LipoCmd
314+ shell : pwsh
315+
298316 - name : Upload native components
299317 uses : actions/upload-artifact@v7
300318 with :
0 commit comments