-
Notifications
You must be signed in to change notification settings - Fork 267
Pipeline for releasing Azure DevOps Extension #6487
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
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
80179dd
EngSys for publishing azdo setup extension
danieljurek 7d6d3d1
Variables param
danieljurek 9e7adea
workingDirectory
danieljurek 497d0fb
Revert "Apply azdo ext best practices for testing and fix mocks for W…
vhvb1989 1cbf3fa
Bring over ext/azuredevops from main
danieljurek d312fee
Remove files not in main
danieljurek f61c3e0
Revert 1es-redirect.yml to main
danieljurek f2cd89d
Use 1es-redirect.yml from main
danieljurek 6c9656f
update tests for Mac
vhvb1989 c1f1001
cspell
vhvb1989 eb52c70
Paths
danieljurek 8a5df91
use FullName (as per docs)
danieljurek 29096e1
Path
danieljurek 35c0428
Enable publishing
danieljurek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,5 +3,6 @@ codepaths | |
| LASTEXITCODE | ||
| tmrm | ||
| toolrunner | ||
| TOOLSDIRECTORY | ||
| tsbuildinfo | ||
| vsix | ||
| vsix | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
eng/pipelines/templates/stages/azuredevops-build-and-test.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |
64 changes: 64 additions & 0 deletions
64
eng/pipelines/templates/stages/azuredevops-publish-manual.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| os: linux | ||
|
|
||
| templateContext: | ||
| type: releaseJob | ||
| isProduction: true | ||
| inputs: | ||
| - input: pipelineArtifact | ||
| artifactName: signed | ||
| targetPath: signed | ||
|
|
||
| strategy: | ||
| runOnce: | ||
| deploy: | ||
| steps: | ||
| - pwsh: | | ||
| $files = Get-ChildItem -Path "$(Build.SourcesDirectory)/signed/*.vsix" | ||
| if ($files -is [Array]) { | ||
| if ($files.Count -gt 1) { | ||
| Write-Host "More than one VSIX file found in signed artifact." | ||
| exit 1 | ||
| } | ||
| $vsixFile = $files[0].FullName | ||
| } else { | ||
| $vsixFile = $files.FullName | ||
| } | ||
|
|
||
| Write-Host "##vso[task.setvariable variable=VSIX_FILE]$vsixFile" | ||
| displayName: Get VSIX Filename | ||
|
|
||
| - task: 1ES.PublishAzureDevOpsExtension@1 | ||
| displayName: Publish Extension | ||
| inputs: | ||
| targetPath: "$(Build.SourcesDirectory)/signed" | ||
| connectedServiceNameAzureRM: azure-sdk-vsmarketplace | ||
| fileType: vsix | ||
| vsixFile: "$(VSIX_FILE)" | ||
| useV5: true | ||
| validateExtension: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #!/usr/bin/env pwsh | ||
| npm --prefix $PSScriptRoot/setupAzd/ test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.