diff --git a/.azure-pipelines/_release-template.yml b/.azure-pipelines/_release-template.yml deleted file mode 100644 index ba61b4d4dc..0000000000 --- a/.azure-pipelines/_release-template.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Template steps for the release pipeline - -steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.11' - displayName: 'Set Up Python' - - script: python -m pip install --upgrade pip build wheel - displayName: 'Install Python build dependencies' - - script: python -m build - displayName: 'Build ONNX Script wheel' - - task: CopyFiles@2 - displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)' - inputs: - SourceFolder: 'dist' - Contents: '*.*' - TargetFolder: '$(Build.ArtifactStagingDirectory)' - - task: PublishBuildArtifacts@1 - displayName: 'Save build artifacts' - inputs: - ArtifactName: onnxscript diff --git a/.azure-pipelines/release-dev.yml b/.azure-pipelines/release-dev.yml index 81ffa68b3a..61f780ed31 100644 --- a/.azure-pipelines/release-dev.yml +++ b/.azure-pipelines/release-dev.yml @@ -3,9 +3,28 @@ # To configure triggers, see https://github.com/microsoft/onnx-converters-private/wiki/ONNX-Script-release trigger: none -pool: - vmImage: ubuntu-latest variables: CI: 'true' -steps: - - template: _release-template.yml + +resources: + repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + +extends: + # The pipeline extends the 1ES PT which will inject different SDL and compliance tasks. + # For non-production pipelines, use "Unofficial" as defined below. + # For productions pipelines, use "Official". + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + parameters: + sdl: + sourceAnalysisPool: + name: onnxruntime-Win-CPU-2022 + os: windows + pool: + name: 'onnxruntime-Ubuntu2204-AMD-CPU' + os: 'linux' + stages: + - template: stages/release-stage.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index fcaf052a47..b5fde4c319 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -2,15 +2,30 @@ trigger: none -pool: - vmImage: ubuntu-latest variables: CI: 'true' # Set the release environment variable to build a release version of the wheel ONNX_SCRIPT_RELEASE: 1 -steps: - - template: _release-template.yml - # Test the wheels. This needs to happen after PublishBuildArtifacts - # to avoid interference with the artifacts - - script: python -m pip install dist/*.whl --no-deps - displayName: 'Install wheel' + +resources: + repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + +extends: + # The pipeline extends the 1ES PT which will inject different SDL and compliance tasks. + # For non-production pipelines, use "Unofficial" as defined below. + # For productions pipelines, use "Official". + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + parameters: + sdl: + sourceAnalysisPool: + name: onnxruntime-Win-CPU-2022 + os: windows + pool: + name: 'onnxruntime-Ubuntu2204-AMD-CPU' + os: 'linux' + stages: + - template: stages/release-stage.yml diff --git a/.azure-pipelines/stages/jobs/steps/release-steps.yml b/.azure-pipelines/stages/jobs/steps/release-steps.yml new file mode 100644 index 0000000000..be1d9e8860 --- /dev/null +++ b/.azure-pipelines/stages/jobs/steps/release-steps.yml @@ -0,0 +1,20 @@ +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '3.11' + displayName: 'Set Up Python' +- script: python -m pip install --upgrade pip build wheel + displayName: 'Install Python build dependencies' +- script: python -m build + displayName: 'Build ONNX Script wheel' +- task: CopyFiles@2 + displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)' + inputs: + SourceFolder: 'dist' + Contents: '*.*' + TargetFolder: '$(Build.ArtifactStagingDirectory)' +- task: 1ES.PublishPipelineArtifact@1 + displayName: 'Publish Python Wheel' + inputs: + ArtifactName: 'onnxscript' + targetPath: '$(Build.ArtifactStagingDirectory)' diff --git a/.azure-pipelines/stages/release-stage.yml b/.azure-pipelines/stages/release-stage.yml new file mode 100644 index 0000000000..881fdbd60b --- /dev/null +++ b/.azure-pipelines/stages/release-stage.yml @@ -0,0 +1,11 @@ +stages: +- stage: Stage + jobs: + - job: Job + steps: + - template: jobs/steps/release-steps.yml + # Test the wheels. This needs to happen after PublishBuildArtifacts + # to avoid interference with the artifacts + - script: python -m pip install dist/*.whl --no-deps + displayName: 'Install wheel' + condition: eq(variables['ONNX_SCRIPT_RELEASE'], 1)