From 0fbd4095b417b66b31b172765c50b53661273768 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 6 Feb 2024 21:37:56 +0100 Subject: [PATCH] devops: migrate to 1ES PT templates (#2278) --- .azure-pipelines/publish.yml | 83 +++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 35 deletions(-) diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index 74c85ea53..e7f2aa385 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -1,38 +1,51 @@ -# don't trigger for Pull Requests +trigger: none pr: none -trigger: - tags: - include: - - '*' +resources: + repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release -pool: - vmImage: ubuntu-latest - -steps: -- task: UsePythonVersion@0 - inputs: - versionSpec: '3.8' - displayName: 'Use Python' - -- script: | - python -m pip install --upgrade pip - pip install -r local-requirements.txt - pip install -e . - python setup.py bdist_wheel --all - displayName: 'Install & Build' - -- task: EsrpRelease@4 - inputs: - ConnectedServiceName: 'Playwright-ESRP' - Intent: 'PackageDistribution' - ContentType: 'PyPi' - ContentSource: 'Folder' - FolderLocation: './dist/' - WaitForReleaseCompletion: true - Owners: 'maxschmitt@microsoft.com' - Approvers: 'maxschmitt@microsoft.com' - ServiceEndpointUrl: 'https://api.esrp.microsoft.com' - MainPublisher: 'Playwright' - DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' - displayName: 'ESRP Release to PIP' +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + parameters: + pool: + name: DevDivPlaywrightAzurePipelinesUbuntu2204 + os: linux + sdl: + sourceAnalysisPool: + name: DevDivPlaywrightAzurePipelinesWindows2022 + # The image must be windows-based due to restrictions of the SDL tools. See: https://aka.ms/AAo6v8e + # In the case of a windows build, this can be the same as the above pool image. + os: windows + stages: + - stage: Stage + jobs: + - job: HostJob + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.8' + displayName: 'Use Python' + - script: | + python -m pip install --upgrade pip + pip install -r local-requirements.txt + pip install -e . + python setup.py bdist_wheel --all + displayName: 'Install & Build' + - task: EsrpRelease@4 + inputs: + ConnectedServiceName: 'Playwright-ESRP' + Intent: 'PackageDistribution' + ContentType: 'PyPi' + ContentSource: 'Folder' + FolderLocation: './dist/' + WaitForReleaseCompletion: true + Owners: 'maxschmitt@microsoft.com' + Approvers: 'maxschmitt@microsoft.com' + ServiceEndpointUrl: 'https://api.esrp.microsoft.com' + MainPublisher: 'Playwright' + DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' + displayName: 'ESRP Release to PIP'