onnxruntime/tools/ci_build/github/azure-pipelines/mac-ios-packaging-pipeline.yml
Jian Chen fa68ae2def
Update pool to MacOS-13 (#17361)
### Description
See https://github.com/microsoft/onnxruntime-extensions/pull/476
and https://github.com/actions/runner-images/issues/7671

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

### Current issue
- [ ] For default xcode 15.2, that come with the MacOS-13, We Need to
update the boost container header boost/container_hash/hash.hpp version
to pass the build
- [x] For xcode 14.2 The Build passed but the `Run React Native Detox
Android e2e Test` Failed.
Possible flaky test, https://github.com/microsoft/onnxruntime/pull/21969
- [x] For xcode 14.3.1 We encountered following issue in `Build React
Native Detox iOS e2e Tests`
```
ld: file not found: /Applications/Xcode_14.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
Applied following code to the eof in both ios/Podfile and fixed the
issue
```
post_install do |installer|
    installer.generated_projects.each do |project|
        project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
            end
        end
    end
end
```


- [x] https://github.com/facebook/react-native/issues/32483

Applying changes to ios/Pofile
```
pre_install do |installer|
  # Custom pre-install script or commands
  puts "Running pre-install script..."

  # Recommended fix for https://github.com/facebook/react-native/issues/32483
  # from https://github.com/facebook/react-native/issues/32483#issuecomment-966784501
  system("sed -i '' 's/typedef uint8_t clockid_t;//' \"${SRCROOT}/Pods/RCT-Folly/folly/portability/Time.h\"")
end
```

- [ ] Detox environment setting up exceeded time out of 120000ms during
iso e2e test


### dependent 

- [x] https://github.com/microsoft/onnxruntime/pull/21159

---------

Co-authored-by: Changming Sun <chasun@microsoft.com>
2024-09-17 10:07:30 -07:00

99 lines
2.4 KiB
YAML

##### start trigger Don't edit it manually, Please do edit set-trigger-rules.py ####
### please do rerun set-trigger-rules.py ###
trigger:
branches:
include:
- main
- rel-*
paths:
exclude:
- docs/**
- README.md
- CONTRIBUTING.md
- BUILD.md
- 'js/web'
- 'onnxruntime/core/providers/js'
pr:
branches:
include:
- main
- rel-*
paths:
exclude:
- docs/**
- README.md
- CONTRIBUTING.md
- BUILD.md
- 'js/web'
- 'onnxruntime/core/providers/js'
#### end trigger ####
parameters:
- name: buildType
displayName: |-
Type of build.
"release": A release build to be published for an official ONNX Runtime release.
"normal": A normal build. This can be published as a pre-release build for validation prior to release.
type: string
values:
- release
- normal
default: normal
name: "$(Date:yyyyMMdd)$(Rev:rrr)" # build number format
stages:
- stage: IosPackaging_SetCommonVariables
dependsOn: []
variables:
skipComponentGovernanceDetection: true
jobs:
- job: j
displayName: "Set common variables"
pool:
vmImage: "macOS-13"
timeoutInMinutes: 5
steps:
- bash: |
set -e
BUILD_TYPE="${{ parameters.buildType }}"
BASE_VERSION="$(cat ./VERSION_NUMBER)"
SHORT_COMMIT_HASH="$(git rev-parse --short HEAD)"
DEV_VERSION="${BASE_VERSION}-dev+$(Build.BuildNumber).${SHORT_COMMIT_HASH}"
case "${BUILD_TYPE}" in
("release")
VERSION="${BASE_VERSION}" ;;
("normal")
VERSION="${DEV_VERSION}" ;;
(*)
echo "Invalid build type: ${BUILD_TYPE}"; exit 1 ;;
esac
# Do not output ##vso[] commands with `set -x` or they may be parsed again and include a trailing quote.
set +x
set_var() {
local VAR_NAME=${1:?}
local VAR_VALUE=${2:?}
echo "##vso[task.setvariable variable=${VAR_NAME};isoutput=true;isreadonly=true]${VAR_VALUE}"
echo "${VAR_NAME}: ${VAR_VALUE}"
}
set_var "ORT_POD_VERSION" "${VERSION}"
displayName: "Set common variables"
name: SetCommonVariables
- template: templates/stages/mac-ios-packaging-build-stage.yml
parameters:
packageVariant: Full
- template: templates/stages/mac-ios-packaging-build-stage.yml
parameters:
packageVariant: Training