Skip to content

Commit

Permalink
refine the code
Browse files Browse the repository at this point in the history
  • Loading branch information
chunyu3 committed Nov 28, 2024
1 parent bc2c2fe commit b2c86ad
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions eng/tsp-core/pipelines/pr-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,17 @@ extends:
SourceFolder: "$(Build.SourcesDirectory)/packages/typespec-vscode"
Contents: "*.vsix"
TargetFolder: "$(Build.ArtifactStagingDirectory)/vscode-extension"

- task: PublishPipelineArtifact@1
displayName: "Publish VSCode extension artifact"
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/vscode-extension'
artifactName: 'vscode-extension-unsigned'

- script: |
echo "##[section]Retrieving artifact URL..."
artifactUrl=$(curl -s -u :$(System.AccessToken) "$(System.TeamFoundationCollectionUri)/$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/artifacts?artifactsName=vscode-extension-unsigned&api-version=7.1-preview.5" | jq -r '.value.resource.downloadUrl')
artifactUrl=$(curl -s -u :$(System.AccessToken) "$(System.TeamFoundationCollectionUri)/$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/artifacts?artifactName=vscode-extension-unsigned" | jq -r 'resource.downloadUrl')
echo "Artifact URL: $artifactUrl"
echo "##vso[task.setvariable variable=vscodeUrl]$artifactUrl"
displayName: Get vscode artifact URL
Expand All @@ -83,13 +91,6 @@ extends:
GH_TOKEN: $(azuresdk-github-pat)
VSCODE_DOWNLOAD_URL: $(vscodeUrl)

templateContext:
outputs:
- output: pipelineArtifact
path: $(Build.ArtifactStagingDirectory)/vscode-extension
artifact: vscode-extension-unsigned
displayName: Publish VSCode extension(.vsix) as pipeline artifacts

- job: change_comment
displayName: Describe changes on PR
condition: and(succeeded(), eq(startsWith(variables['System.PullRequest.SourceBranch'], 'publish/'), false))
Expand Down

0 comments on commit b2c86ad

Please sign in to comment.