-
Notifications
You must be signed in to change notification settings - Fork 267
Azure DevOps Extension Release Pipeline #6507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
80179dd
7d6d3d1
9e7adea
497d0fb
1cbf3fa
d312fee
f61c3e0
f2cd89d
6c9656f
c1f1001
eb52c70
8a5df91
29096e1
35c0428
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,5 +3,6 @@ codepaths | |
| LASTEXITCODE | ||
| tmrm | ||
| toolrunner | ||
| TOOLSDIRECTORY | ||
| tsbuildinfo | ||
| vsix | ||
| vsix | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Continuous deployment trigger | ||
| trigger: | ||
| branches: | ||
| include: | ||
| - main | ||
| paths: | ||
| include: | ||
| - ext/azuredevops | ||
| - eng/pipelines/release-azuredevops.yml | ||
|
|
||
| pr: | ||
| paths: | ||
| include: | ||
| - ext/azuredevops | ||
| - eng/pipelines/release-azuredevops.yml | ||
|
|
||
| extends: | ||
| template: /eng/pipelines/templates/stages/1es-redirect.yml | ||
| parameters: | ||
| stages: | ||
| - template: /eng/pipelines/templates/stages/azuredevops-build-and-test.yml | ||
|
|
||
| - template: /eng/pipelines/templates/stages/azuredevops-sign.yml | ||
|
|
||
| - template: /eng/pipelines/templates/stages/azuredevops-publish-manual.yml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| parameters: | ||
| - name: NameSuffix | ||
| type: string | ||
| - name: Pool | ||
| type: string | ||
| - name: ImageKey | ||
| type: string | ||
| default: image | ||
| - name: OSVmImage | ||
| type: string | ||
| - name: OS | ||
| type: string | ||
| - name: Variables | ||
| type: object | ||
|
|
||
| jobs: | ||
| - job: Build_${{ parameters.NameSuffix }} | ||
| displayName: Build ${{ parameters.NameSuffix }} | ||
|
|
||
| pool: | ||
| name: ${{ parameters.Pool }} | ||
| ${{ parameters.ImageKey }}: ${{ parameters.OSVmImage }} | ||
| os: ${{ parameters.OS }} | ||
|
|
||
| variables: | ||
| # TODO: What version of Node to use for Azure DevOps extension build? | ||
| NodeVersion: 20.x | ||
| ${{ insert }}: ${{ parameters.Variables }} | ||
|
|
||
| steps: | ||
| - checkout: self | ||
|
|
||
| - task: NodeTool@0 | ||
| inputs: | ||
| versionSpec: $(NodeVersion) | ||
|
|
||
| - pwsh: | | ||
| npm i -g npm tfx-cli | ||
| npm ci | ||
| displayName: Install build tools and dependencies | ||
| workingDirectory: ext/azuredevops/setupAzd | ||
|
|
||
| # TODO: If private build, update vss-extension.json and other JSONs to | ||
| # set a dev version | ||
|
|
||
| - task: PowerShell@2 | ||
| inputs: | ||
| targetType: 'filePath' | ||
| filePath: '$(Build.SourcesDirectory)/ext/azuredevops/ci-test.ps1' | ||
| workingDirectory: '$(Build.SourcesDirectory)/ext/azuredevops' | ||
| displayName: Test | ||
|
|
||
| - task: PowerShell@2 | ||
| inputs: | ||
| targetType: 'filePath' | ||
| filePath: '$(Build.SourcesDirectory)/ext/azuredevops/ci-package.ps1' | ||
| workingDirectory: '$(Build.SourcesDirectory)/ext/azuredevops' | ||
| displayName: Package Extension | ||
|
|
||
| - pwsh: | | ||
| Copy-Item ` | ||
| -Path "$(Build.SourcesDirectory)/ext/azuredevops/*.vsix" ` | ||
| -Destination "$(Build.ArtifactStagingDirectory)/" | ||
| condition: and(succeeded(), eq('true', variables['UploadArtifact'])) | ||
| displayName: Copy VSIX to staging directory | ||
|
|
||
| templateContext: | ||
| outputs: | ||
| - output: pipelineArtifact | ||
| path: $(Build.ArtifactStagingDirectory) | ||
| condition: and(succeeded(), eq('true', variables['UploadArtifact'])) | ||
| artifact: vsix |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| parameters: | ||
| - name: BuildMatrix | ||
| type: object | ||
| default: | ||
| Windows: | ||
| Pool: $(WINDOWSPOOL) | ||
| ImageKey: image | ||
| OSVmImage: $(WINDOWSVMIMAGE) | ||
| OS: windows | ||
| Variables: {} | ||
|
|
||
| Linux: | ||
| Pool: $(LINUXPOOL) | ||
| ImageKey: image | ||
| OSVmImage: $(LINUXVMIMAGE) | ||
| OS: linux | ||
| Variables: | ||
| UploadArtifact: 'true' | ||
| Codeql.Enabled: true | ||
| Codeql.SkipTaskAutoInjection: false | ||
| Codeql.BuildIdentifier: azuredevops_linux | ||
|
|
||
| Mac: | ||
| Pool: Azure Pipelines | ||
| ImageKey: vmImage | ||
| OSVmImage: $(MACVMIMAGE) | ||
| OS: macOS | ||
| Variables: {} | ||
|
|
||
| stages: | ||
| - stage: BuildAndTest | ||
| variables: | ||
| - template: /eng/pipelines/templates/variables/globals.yml | ||
| - template: /eng/pipelines/templates/variables/image.yml | ||
|
|
||
| jobs: | ||
| - ${{ each build in parameters.BuildMatrix }}: | ||
| - template: /eng/pipelines/templates/jobs/azuredevops-build.yml | ||
| parameters: | ||
| NameSuffix: ${{ build.key }} | ||
| Pool: ${{ build.value.Pool }} | ||
| ImageKey: ${{ build.value.ImageKey }} | ||
| OSVmImage: ${{ build.value.OSVmImage }} | ||
| OS: ${{ build.value.OS }} | ||
| Variables: ${{ build.value.Variables }} |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,64 @@ | ||||||
| stages: | ||||||
| - stage: PublishManual | ||||||
| dependsOn: Sign | ||||||
| condition: >- | ||||||
| and( | ||||||
| succeeded(), | ||||||
| ne(variables['Skip.Release'], 'true'), | ||||||
| or( | ||||||
| eq('Manual', variables['BuildReasonOverride']), | ||||||
| and( | ||||||
| eq('', variables['BuildReasonOverride']), | ||||||
| eq(variables['Build.Reason'], 'Manual') | ||||||
| ) | ||||||
| ) | ||||||
| ) | ||||||
|
|
||||||
| variables: | ||||||
| - template: /eng/pipelines/templates/variables/globals.yml | ||||||
| - template: /eng/pipelines/templates/variables/image.yml | ||||||
|
|
||||||
| jobs: | ||||||
| - deployment: Publish_Release | ||||||
| environment: package-publish | ||||||
| pool: | ||||||
| name: azsdk-pool | ||||||
| image: ubuntu-24.04 | ||||||
|
||||||
| image: ubuntu-24.04 | |
| image: $(LINUXVMIMAGE) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| stages: | ||
| - stage: Sign | ||
| dependsOn: BuildAndTest | ||
| variables: | ||
| - template: /eng/pipelines/templates/variables/globals.yml | ||
| - template: /eng/pipelines/templates/variables/image.yml | ||
|
|
||
| jobs: | ||
| - job: Sign | ||
| ${{ if in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual') }}: | ||
| displayName: Sign | ||
| ${{ else }}: | ||
| displayName: SKIP Signing | ||
|
|
||
| pool: | ||
| name: $(WINDOWSPOOL) | ||
| image: $(WINDOWSVMIMAGE) | ||
| os: windows | ||
|
|
||
| steps: | ||
| - task: DownloadPipelineArtifact@2 | ||
| inputs: | ||
| artifact: vsix | ||
| path: vsix | ||
|
|
||
| - ${{ if in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual') }}: | ||
| - template: pipelines/steps/azd-azdo-extension-signing.yml@azure-sdk-build-tools | ||
| parameters: | ||
| Path: $(Build.SourcesDirectory)\vsix | ||
| Pattern: '*.vsix' | ||
|
|
||
| - ${{ else }}: | ||
| - pwsh: Write-Host "Skipping signing. Build reason - $(Build.Reason)" | ||
| displayName: Signing process skipped for non-release build | ||
|
|
||
| - pwsh: | | ||
| New-Item -ItemType Directory -Path signed | ||
| Copy-Item vsix/*.vsix signed/ | ||
| displayName: Copy signing outputs | ||
| condition: always() | ||
|
|
||
| templateContext: | ||
| outputs: | ||
| - output: pipelineArtifact | ||
| condition: succeeded() | ||
| displayName: Publish Signed Artifacts | ||
| artifact: signed | ||
| path: signed/ | ||
|
|
||
| - output: pipelineArtifact | ||
| condition: failed() | ||
| displayName: Publish failed Signed Artifacts | ||
| artifact: signed-FailedAttempt$(System.JobAttempt) | ||
| path: signed/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env pwsh | ||
|
|
||
| $originalLocation = Get-Location | ||
|
|
||
| try { | ||
| Set-Location $PSScriptRoot | ||
|
|
||
| Write-Host "Running tsc build" | ||
| npm --prefix $PSScriptRoot/setupAzd/ run build | ||
| if ($LASTEXITCODE) { | ||
| Write-Host "Build failed" | ||
| exit $LASTEXITCODE | ||
| } | ||
| Write-Host "Building Azure DevOps extension package" | ||
| tfx extension create --manifest-globs vss-extension.json | ||
| if ($LASTEXITCODE) { | ||
| Write-Host "Packaging failed" | ||
| exit $LASTEXITCODE | ||
| } | ||
|
|
||
| } finally { | ||
| Set-Location $originalLocation | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,2 @@ | ||||||||||||||
| #!/usr/bin/env pwsh | ||||||||||||||
| npm --prefix $PSScriptRoot/setupAzd/ test | ||||||||||||||
|
||||||||||||||
| npm --prefix $PSScriptRoot/setupAzd/ test | |
| npm --prefix $PSScriptRoot/setupAzd/ test | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Error "npm test failed with exit code $LASTEXITCODE." | |
| exit $LASTEXITCODE | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pool name 'azsdk-pool' is hard-coded here, while other pipeline files use '$(LINUXPOOL)' from the globals template. For consistency and easier maintenance across the pipeline, consider using the variable reference '$(LINUXPOOL)' instead.