diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml new file mode 100644 index 000000000..382e4c4fa --- /dev/null +++ b/.azure-pipelines/publish.yml @@ -0,0 +1,47 @@ +pr: none + +trigger: + tags: + include: + - '*' + +resources: + repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + +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: UseNode@1 + inputs: + version: '20.x' + displayName: 'Install Node.js' + - script: npm ci + displayName: 'Install dependencies' + - task: AzureCLI@2 + displayName: 'Publishing with Managed Identity' + inputs: + azureSubscription: 'Playwright-VSMarketplacePublishing' + scriptType: "pscore" + scriptLocation: 'inlineScript' + inlineScript: | + $aadToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv + npx vsce verify-pat --pat $aadToken ms-playwright + npx vsce publish --pre-release --pat $aadToken diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index f8e7c8211..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Publish -on: - release: - types: [published] -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: npm ci - - name: Publish release - if: github.event.release.prerelease == false - run: npx vsce publish --pat "${{ secrets.VSC_MARKETPLACE_PAT }}" - - name: Publish pre-release - if: github.event.release.prerelease == true - run: npx vsce publish --pre-release --pat "${{ secrets.VSC_MARKETPLACE_PAT }}"