From b6313a6f7e146cbf90f947ff7b38f643d2b39b94 Mon Sep 17 00:00:00 2001 From: Varad Date: Mon, 14 Nov 2022 23:52:44 -0600 Subject: [PATCH 1/2] Testing a new build for Mac M1 --- azure-pipelines.yml | 23 ++++++++++++++++++++++ pack/scripts/mac_deps.sh | 13 +++++++++++++ pack/templates/mac_m1_env_gen.yml | 32 +++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 pack/scripts/mac_deps.sh create mode 100644 pack/templates/mac_m1_env_gen.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e8653936..f692fd7c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -110,6 +110,29 @@ jobs: pythonVersion: '$(pythonVersion)' workerPath: '$(workerPath)' artifactName: '$(pythonVersion)_OSX_X64' +- job: Build_OSX_ARM64 + pool: + vmImage: 'macOS-12' + strategy: + matrix: + Python37V4: + pythonVersion: '3.7' + workerPath: $(PROD_V4_WORKER_PY) + Python38V4: + pythonVersion: '3.8' + workerPath: $(PROD_V4_WORKER_PY) + Python39V4: + pythonVersion: '3.9' + workerPath: $(PROD_V4_WORKER_PY) + Python310V4: + pythonVersion: '3.10' + workerPath: $(PROD_V4_WORKER_PY) + steps: + - template: pack/templates/mac_m1_env_gen.yml + parameters: + pythonVersion: '$(pythonVersion)' + workerPath: '$(workerPath)' + artifactName: '$(pythonVersion)_OSX_ARM64' - job: PackageWorkers dependsOn: ['Build_WINDOWS_X64', 'Build_WINDOWS_X86', 'Build_LINUX_X64', 'Build_OSX_X64'] diff --git a/pack/scripts/mac_deps.sh b/pack/scripts/mac_deps.sh new file mode 100644 index 00000000..7577a529 --- /dev/null +++ b/pack/scripts/mac_deps.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +python -m venv .env +source .env/bin/activate +python -m pip install --upgrade pip + +#python -m pip install . + +python -m pip install . \ + --platform manylinux_2_17_aarch64 \ + --platform macosx_10_9_universal2 \ + --only-binary=:all: \ + --target "$BUILD_SOURCESDIRECTORY/deps" \ diff --git a/pack/templates/mac_m1_env_gen.yml b/pack/templates/mac_m1_env_gen.yml new file mode 100644 index 00000000..58c714ad --- /dev/null +++ b/pack/templates/mac_m1_env_gen.yml @@ -0,0 +1,32 @@ +parameters: + pythonVersion: '' + artifactName: '' + workerPath: '' + +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: ${{ parameters.pythonVersion }} + addToPath: true +- task: ShellScript@2 + inputs: + disableAutoCwd: true + scriptPath: 'pack/scripts/mac_deps.sh' +- task: CopyFiles@2 + inputs: + contents: | + ${{ parameters.workerPath }} + targetFolder: '$(Build.ArtifactStagingDirectory)' + flattenFolders: true +- task: CopyFiles@2 + inputs: + sourceFolder: '$(Build.SourcesDirectory)/deps' + contents: | + ** + !grpc_tools/**/* + !grpcio_tools*/* + targetFolder: '$(Build.ArtifactStagingDirectory)' +- task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: ${{ parameters.artifactName }} From 123cc09675062e87b8e33dc387b8a49a6448b94d Mon Sep 17 00:00:00 2001 From: Varad Date: Mon, 14 Nov 2022 23:54:04 -0600 Subject: [PATCH 2/2] Enabling OSX build --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f692fd7c..24a35169 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -135,7 +135,7 @@ jobs: artifactName: '$(pythonVersion)_OSX_ARM64' - job: PackageWorkers - dependsOn: ['Build_WINDOWS_X64', 'Build_WINDOWS_X86', 'Build_LINUX_X64', 'Build_OSX_X64'] + dependsOn: ['Build_WINDOWS_X64', 'Build_WINDOWS_X86', 'Build_LINUX_X64', 'Build_OSX_X64', 'Build_OSX_ARM64'] condition: or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), eq(variables['Build.SourceBranch'], 'refs/heads/dev')) pool: name: '1ES-Hosted-AzFunc'