sync repo source code with rel-1.15.0 and update yml files into two stages
This commit is contained in:
@@ -3,193 +3,111 @@ parameters:
|
||||
displayName: |-
|
||||
Type of build.
|
||||
"normal": A normal build not for publication.
|
||||
type: string #TODO: add other build types name here
|
||||
type: string #TODO: add other build types here
|
||||
values:
|
||||
- normal
|
||||
default: normal
|
||||
|
||||
name: "$(Date:yyyyMMdd)$(Rev:rrr)" # build number format
|
||||
|
||||
jobs:
|
||||
- job: SPMIosPackaging
|
||||
displayName: "SPM iOS Packaging"
|
||||
stages:
|
||||
- stage: SPM iOS local packaging testing
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- job: SPMIosPackaging
|
||||
displayName: "SPM iOS Packaging"
|
||||
|
||||
pool:
|
||||
vmImage: "macOS-13"
|
||||
|
||||
variables:
|
||||
xcodeVersion: "14.3"
|
||||
podArchiveName: ""
|
||||
artifactsNamne: "ios_packaging_artifacts" #TODO: Add `_full` suffix when syncing to latest main
|
||||
|
||||
timeoutInMinutes: 300
|
||||
|
||||
steps:
|
||||
# - task: InstallAppleCertificate@2
|
||||
# inputs:
|
||||
# certSecureFile: '$(ios_signing_certificate_name)'
|
||||
# certPwd: '$(ios_signing_certificate_password)'
|
||||
# keychain: 'temp'
|
||||
# deleteCert: true
|
||||
# displayName: 'Install ORT Mobile Test Signing Certificate'
|
||||
|
||||
# - task: InstallAppleProvisioningProfile@1
|
||||
# inputs:
|
||||
# provProfileSecureFile: '$(ios_provision_profile_name)'
|
||||
# removeProfile: true
|
||||
# displayName: 'Install ORT Mobile Test Provisioning Profile'
|
||||
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: "3.9"
|
||||
addToPath: true
|
||||
architecture: "x64"
|
||||
|
||||
- template: templates/use-xcode-version.yml
|
||||
parameters:
|
||||
xcodeVersion: ${{ variables.xcodeVersion }}
|
||||
|
||||
# - template: templates/install-appcenter.yml
|
||||
|
||||
- script: |
|
||||
pip install -r tools/ci_build/github/requirements.txt
|
||||
displayName: "Install Python requirements"
|
||||
|
||||
- bash: |
|
||||
set -e
|
||||
|
||||
BUILD_TYPE="${{ parameters.BuildType }}"
|
||||
VERSION_FILE="$(Build.SourcesDirectory)/version.txt"
|
||||
BASE_VERSION="$(cat "${VERSION_FILE}")"
|
||||
SHORT_COMMIT_HASH="$(git rev-parse --short HEAD)"
|
||||
DEV_VERSION="${BASE_VERSION}-dev+$(Build.BuildNumber).${SHORT_COMMIT_HASH}"
|
||||
|
||||
case "${BUILD_TYPE}" in
|
||||
("normal")
|
||||
VERSION="${DEV_VERSION}"; SHOULD_UPLOAD_ARCHIVES="false" ;;
|
||||
(*)
|
||||
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}]${VAR_VALUE}"
|
||||
echo "${VAR_NAME}: ${VAR_VALUE}"
|
||||
}
|
||||
|
||||
set_var "ORT_POD_VERSION" "${VERSION}"
|
||||
set_var "ORT_SHOULD_UPLOAD_ARCHIVES" "${SHOULD_UPLOAD_ARCHIVES}"
|
||||
displayName: "Set variables"
|
||||
|
||||
# - script: |
|
||||
# $(Build.SourcesDirectory)/tools/ci_build/github/scripts/install_protobuf.sh -p $(Build.BinariesDirectory)/protobuf_install -d $(Build.SourcesDirectory)/cmake/deps.txt
|
||||
# displayName: "Build Host Protoc"
|
||||
|
||||
# # create and test full pods
|
||||
# - script: |
|
||||
# python tools/ci_build/github/scripts/build_and_assemble_ios_pods.py \
|
||||
# --build-dir "$(Build.BinariesDirectory)/ios_framework_full" \
|
||||
# --staging-dir "$(Build.BinariesDirectory)/staging" \
|
||||
# --pod-version "${ORT_POD_VERSION}" \
|
||||
# --test \
|
||||
# --variant Full \
|
||||
# --build-settings-file tools/ci_build/github/default_full_ios_framework_build_settings.json \
|
||||
# -b="--path_to_protoc_exe" -b "$(Build.BinariesDirectory)/protobuf_install/bin/protoc"
|
||||
# displayName: "[Full] Build iOS framework and assemble pod package files"
|
||||
|
||||
# - script: |
|
||||
# python tools/ci_build/github/scripts/test_ios_packages.py \
|
||||
# --fail_if_cocoapods_missing \
|
||||
# --framework_info_file "$(Build.BinariesDirectory)/ios_framework_full/framework_info.json" \
|
||||
# --c_framework_dir "$(Build.BinariesDirectory)/ios_framework_full/framework_out" \
|
||||
# --variant Full \
|
||||
# --test_project_stage_dir "$(Build.BinariesDirectory)/app_center_test_full" \
|
||||
# --prepare_test_project_only
|
||||
# displayName: "[Full] Assemble test project for App Center"
|
||||
|
||||
# - task: Xcode@5
|
||||
# inputs:
|
||||
# actions: 'build-for-testing'
|
||||
# configuration: 'Debug'
|
||||
# xcWorkspacePath: '$(Build.BinariesDirectory)/app_center_test_full/ios_package_test/ios_package_test.xcworkspace'
|
||||
# sdk: 'iphoneos'
|
||||
# scheme: 'ios_package_test'
|
||||
# signingOption: 'manual'
|
||||
# signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
|
||||
# provisioningProfileName: 'iOS Team Provisioning Profile'
|
||||
# args: '-derivedDataPath $(Build.BinariesDirectory)/app_center_test_full/ios_package_test/DerivedData'
|
||||
# workingDirectory: $(Build.BinariesDirectory)/app_center_test_full/ios_package_test/
|
||||
# displayName: '[Full] Build iphone arm64 tests'
|
||||
|
||||
# - script: |
|
||||
# set -e -x
|
||||
# appcenter test run xcuitest \
|
||||
# --app "AI-Frameworks/ORT-Mobile-iOS" \
|
||||
# --devices $(app_center_test_devices) \
|
||||
# --test-series "master" \
|
||||
# --locale "en_US" \
|
||||
# --build-dir $(Build.BinariesDirectory)/app_center_test_full/ios_package_test/DerivedData/Build/Products/Debug-iphoneos \
|
||||
# --token $(app_center_api_token)
|
||||
# displayName: "[Full] Run E2E tests on App Center"
|
||||
|
||||
# - task: AzureCLI@2
|
||||
# inputs:
|
||||
# azureSubscription: 'AIInfraBuildOnnxRuntimeOSS'
|
||||
# scriptType: 'bash'
|
||||
# scriptLocation: 'scriptPath'
|
||||
# scriptPath: 'tools/ci_build/github/apple/assemble_ios_packaging_artifacts.sh'
|
||||
# arguments: >-
|
||||
# "$(Build.BinariesDirectory)/staging"
|
||||
# "$(Build.ArtifactStagingDirectory)"
|
||||
# "$(ORT_POD_VERSION)"
|
||||
# "$(ORT_SHOULD_UPLOAD_ARCHIVES)"
|
||||
# displayName: "Assemble artifacts"
|
||||
|
||||
# TODO: Download artifacts from the onnxruntime-ios-packaging pipeline artifacts folder
|
||||
|
||||
# Download artifacts from a specific pipeline.
|
||||
# Download artifacts from a specific pipeline
|
||||
# For now, it consumes rel-1.15.0 version ORT iOS Pod which matches the current source code
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
buildType: 'specific'
|
||||
project: 'Lotus'
|
||||
definition: 995
|
||||
buildVersionToDownload: 'latest'
|
||||
buildVersionToDownload: 'latestFromBranch'
|
||||
branchName: 'rel-1.15.0'
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||
|
||||
- script: |
|
||||
set -e -x
|
||||
ls
|
||||
workingDirectory: '$(Build.ArtifactStagingDirectory)/ios_packaging_artifacts_full'
|
||||
workingDirectory: '$(Build.ArtifactStagingDirectory)/$(artifactsName)'
|
||||
displayName: "List staged artifacts"
|
||||
|
||||
|
||||
# copy the pod archive to a path relative to Package.swift and set the env var required by Package.swift to use that.
|
||||
# xcodebuild will implicitly use Package.swift and build/run the .testTarget (tests in swift/onnxTests).
|
||||
# once that's done cleanup the copy of the pod zip file
|
||||
- script: |
|
||||
set -e -x
|
||||
cd "$(Build.ArtifactStagingDirectory)/ios_packaging_artifacts_full"
|
||||
cd "$(Build.ArtifactStagingDirectory)/$(artifactsName)"
|
||||
ARTIFACTS_LIST=$(ls)
|
||||
POD_ARCHIVE=$(echo "${ARTIFACTS_LIST}" | sed -n '3p')
|
||||
POD_ARCHIVE=$(echo "${ARTIFACTS_LIST}" | sed -n '5p')
|
||||
|
||||
shasum -a 256 "$(Build.ArtifactStagingDirectory)/ios_packaging_artifacts_full/${POD_ARCHIVE}"
|
||||
shasum -a 256 "$(Build.ArtifactStagingDirectory)/$(artifactsName)/${POD_ARCHIVE}"
|
||||
|
||||
cd "$(Build.SourcesDirectory)"
|
||||
|
||||
cp "$(Build.ArtifactStagingDirectory)/ios_packaging_artifacts_full/${POD_ARCHIVE}" swift/
|
||||
cp "$(Build.ArtifactStagingDirectory)/$(artifactsName)/${POD_ARCHIVE}" swift/
|
||||
export ORT_IOS_POD_LOCAL_PATH="swift/${POD_ARCHIVE}"
|
||||
|
||||
xcodebuild test -scheme onnxruntime -destination 'platform=iOS Simulator,name=iPhone 14'
|
||||
rm swift/pod-archive-onnxruntime-c-*.zip
|
||||
workingDirectory: "$(Build.SourcesDirectory)"
|
||||
displayName: "Test Package.swift usage"
|
||||
displayName: "Print ORT iOS Pod checksum and test Package.swift usage"
|
||||
|
||||
# - publish: "$(Build.ArtifactStagingDirectory)"
|
||||
# artifact: ios_packaging_artifacts
|
||||
# displayName: "Publish artifacts"
|
||||
- publish: "$(Build.ArtifactStagingDirectory)/$(artifactName)"
|
||||
artifact: ios_packaging_artifacts
|
||||
displayName: "Publish artifacts"
|
||||
|
||||
# - template: templates/component-governance-component-detection-steps.yml
|
||||
# parameters :
|
||||
# condition : 'succeeded'
|
||||
- template: templates/component-governance-component-detection-steps.yml
|
||||
parameters :
|
||||
condition : 'succeeded'
|
||||
|
||||
- stage: SPM iOS release packaging testing
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- job: SPMIosPackaging
|
||||
displayName: "SPM iOS Packaging"
|
||||
|
||||
pool:
|
||||
vmImage: "macOS-13"
|
||||
|
||||
variables:
|
||||
xcodeVersion: "14.3"
|
||||
|
||||
timeoutInMinutes: 300
|
||||
|
||||
steps:
|
||||
- template: templates/use-xcode-version.yml
|
||||
parameters:
|
||||
xcodeVersion: ${{ variables.xcodeVersion }}
|
||||
|
||||
- script: |
|
||||
set -e -x
|
||||
VERSION_FILE="$(Build.SourcesDirectory)/version.txt"
|
||||
SPM_POD_VERSION="$(cat "${VERSION_FILE}")"
|
||||
shasum -a 256 "https://onnxruntimepackages.z14.web.core.windows.net/pod-archive-onnxruntime-c-${SPM_POD_VERSION}.zip"
|
||||
workingDirectory: "$(Build.SourcesDirectory)"
|
||||
displayName: "Print ORT iOS Release Pod checksum"
|
||||
|
||||
- script: |
|
||||
set -e -x
|
||||
xcodebuild test -scheme onnxruntime -destination 'platform=iOS Simulator,name=iPhone 14'
|
||||
workingDirectory: "$(Build.SourcesDirectory)"
|
||||
displayName: "Test Package.swift usage"
|
||||
|
||||
- template: templates/component-governance-component-detection-steps.yml
|
||||
parameters :
|
||||
condition : 'succeeded'
|
||||
|
||||
Reference in New Issue
Block a user