- Notifications
You must be signed in to change notification settings - Fork1.2k
Publish SDK installer artifacts in CI pipeline#52233
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
Co-authored-by: mthalman <15789599+mthalman@users.noreply.github.com>
Co-authored-by: mthalman <15789599+mthalman@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: mthalman <15789599+mthalman@users.noreply.github.com>
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.
Pull request overview
This PR adds SDK installer artifact publishing to the CI pipeline to enable validation and troubleshooting, particularly for Copilot-generated PRs where developers don't have local build output. The change follows repository conventions for minimal, clean modifications and matches existing Arcade patterns.
Key Changes
- Adds a PublishPipelineArtifact task after the build step to publish SDK installer artifacts
- Uses retry-safe naming with
System.JobAttemptto prevent artifact collisions - Includes error handling with
continueOnError: trueandsucceededOrFailed()condition
| artifactName:$(System.PhaseName)_SDK_Attempt$(System.JobAttempt) | ||
| continueOnError:true | ||
| condition:succeededOrFailed() | ||
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.
So, this will double publish. Meaning, adding this here will causeall builds to publish these assets. Internal builds already publish these assets via theenablePublishBuildAssets and the publish-build-assets.yml template:
Lines 291 to 306 in2b7468d
| ############### PUBLISH STAGE ############### | |
| -${{ if ne(variables['Build.Reason'], 'PullRequest') }}: | |
| -stage:publish | |
| displayName:Publish | |
| dependsOn:[] | |
| jobs: | |
| -template:/eng/common/templates-official/job/publish-build-assets.yml@self | |
| parameters: | |
| publishUsingPipelines:true | |
| publishAssetsImmediately:true | |
| isAssetlessBuild:true | |
| repositoryAlias:self | |
| pool: | |
| name:$(DncEngInternalBuildPool) | |
| image:1es-windows-2022 | |
| os:windows |
Wait, reading this, we moved toisAssetlessBuild.@ViktorHofer Does the internal build publish assets? Because adding this will now publish assets and I believed our goal was to no longer publish assets.
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.
Assetless-build PR for reference:#49113
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.
Also wondering if we can just use the Arcade mechanism to publish assets instead of doing it ourselves. Meaning, use the publish-build-assets.yml template instead in the.vsts-pr.yml pipeline directly. Then, it would only happen in external PR builds.
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.
Wait, reading this, we moved to isAssetlessBuild.@ViktorHofer Does the internal build publish assets? Because adding this will now publish assets and I believed our goal was to no longer publish assets.
Yes, sdk shouldn't publish anything in the official assetless build.
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.
Btw, I see that sdk still builds in the official build. I think that was necessary back a few months ago when we didn't preserve intermediates for compliance scanning tools but that got solved meanwhile. Most/all? other repos that enabled assetless builds don't build anymore.
https://dev.azure.com/dnceng/internal/_build/results?buildId=2863248&view=results
@mmitche do you remember if that was indeed the reason when you made the switch?
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.
IIRC it was a desire to still have rolling artifacts produced
Uh oh!
There was an error while loading.Please reload this page.
Summary
This PR successfully adds SDK artifact publishing to the CI pipeline. The implementation:
✅ Publishes SDK installer artifacts (zip/tar.gz/pkg/exe/msi/deb/rpm) from all build jobs
✅ Artifacts are named
{JobName}_SDK_Attempt{N}for easy identification and to avoid collisions on retries✅ Uses
continueOnError: trueto prevent failures from breaking builds✅ Uses
succeededOrFailed()condition to publish artifacts even if build partially fails✅ Follows existing patterns and conventions in the codebase (matches Arcade's retry naming pattern)
✅ Minimal change - only 11 lines added to one file
✅ Well-documented with clear comments
The artifacts will be available under the "Artifacts" section in Azure Pipelines after each job completes, making it easy to download and validate the built SDK for troubleshooting and testing purposes.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn moreCopilot coding agent tips in the docs.