From 64e998d91904f89eaf65ecce52928e9c08ef21d0 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 6 May 2024 21:17:40 +0000 Subject: [PATCH 1/5] devops: migrate publishing to Azure Pipelines for publishing --- .azure-pipelines/publish.yml | 47 +++++++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 19 -------------- 2 files changed, 47 insertions(+), 19 deletions(-) create mode 100644 .azure-pipelines/publish.yml delete mode 100644 .github/workflows/publish.yml 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 }}" From 8411a6949f113b9fafcd630f84c8d8a30b1b8649 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 6 May 2024 22:55:27 +0000 Subject: [PATCH 2/5] disabling publishing --- .azure-pipelines/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index 382e4c4fa..a91c754a5 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -44,4 +44,3 @@ extends: 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 From 5c5fd3700ab53119f5152ad9d80256a714dfbb01 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 6 May 2024 23:03:26 +0000 Subject: [PATCH 3/5] add pre-release support --- .azure-pipelines/publish.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index a91c754a5..b988d21dd 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -44,3 +44,8 @@ extends: 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 + if ("$(Build.Reason)" -eq "Manual") { + npx vsce publish --pre-release --pat $aadToken + } else { + npx vsce publish --pat $aadToken + } From 7eb51ad73864c09416383e1cbadfa0e0e86aaef0 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 6 May 2024 23:14:08 +0000 Subject: [PATCH 4/5] test --- .azure-pipelines/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index b988d21dd..aecbf8f84 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -45,7 +45,7 @@ extends: $aadToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv npx vsce verify-pat --pat $aadToken ms-playwright if ("$(Build.Reason)" -eq "Manual") { - npx vsce publish --pre-release --pat $aadToken + Write-Output "Manual trigger" } else { - npx vsce publish --pat $aadToken + Write-Output "Automatic trigger" } From 3e04e79ee54fa65ef572972162e29118d466d4a4 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 6 May 2024 23:20:13 +0000 Subject: [PATCH 5/5] Revert "test" This reverts commit 7eb51ad73864c09416383e1cbadfa0e0e86aaef0. --- .azure-pipelines/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index aecbf8f84..b988d21dd 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -45,7 +45,7 @@ extends: $aadToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv npx vsce verify-pat --pat $aadToken ms-playwright if ("$(Build.Reason)" -eq "Manual") { - Write-Output "Manual trigger" + npx vsce publish --pre-release --pat $aadToken } else { - Write-Output "Automatic trigger" + npx vsce publish --pat $aadToken }