Skip to content

Register dotnetup with BAR for channel-based publishing#54305

Draft
dsplaisted wants to merge 1 commit into
dotnet:release/dnupfrom
dsplaisted:dotnetup-bar-publishing
Draft

Register dotnetup with BAR for channel-based publishing#54305
dsplaisted wants to merge 1 commit into
dotnet:release/dnupfrom
dsplaisted:dotnetup-bar-publishing

Conversation

@dsplaisted
Copy link
Copy Markdown
Member

Register dotnetup with BAR for channel-based publishing

Adds Build Asset Registry (BAR) registration to every non-PR dotnetup build, on top of the existing pipeline-artifact publishing. This is the prerequisite for shipping the dotnetup standalone executables to anonymous-access blob storage (ci.dot.net/public/dotnetup/<SemVer>/) with stable aka.ms/dotnet/dotnetup/daily/<file> shortlinks.

Tracks #54254.

What this PR does

Adds a new publish_to_bar stage to .vsts-dnup-ci.yml that runs on every non-PR build of release/dnup. The stage is additive — it does not change anything about the existing dotnetup-standalone-* pipeline artifacts, which continue to be published exactly as today. It only:

  1. Downloads each per-RID dotnetup-standalone-* pipeline artifact (8 RIDs) onto a Windows agent.
  2. Stages all 16 binary + .sha512 files flat under BlobArtifacts/. This flat layout is required because Arcade's PublishArtifactsInManifestBase.DownloadFileAsync fetches source blobs by basename only when the promotion pipeline runs.
  3. Generates a v3 MergedManifest.xml whose <Blob Id="dotnetup/<SemVer>/<file>" /> entries serve a dual purpose: the basename is the source path inside BlobArtifacts/, the full path is the destination layout under the channel's blob feed.
  4. Calls Arcade's standard publish-build-assets.yml job, which registers the build with BAR.

A small MSBuild target (WriteDotnetupVersionFile in dotnetup.csproj) emits dotnetup.version.txt next to each published binary so the staging job has an authoritative source for the Arcade-composed $(Version) SemVer (no MSBuild file parsing in the pipeline).

End-to-end mechanics validated

Validated in two stages:

1. Experiment branch — promoted BAR build 314208 to General Testing (promotion build 2974290). All 16 binary/checksum assets landed at https://ci.dot.net/dev/dotnetup/0.1.3-preview.4.26263.3/... with HTTP 200 anonymous access.

2. This branch — BAR build 314269 (CI build 2974542) registered 17 assets at dotnetup/0.1.3-preview.4.26263.5/... — identical structure to the experiment build, confirming the cleanups (squashed history, dropped manual gate, robust version-file lookup) didn't regress anything. Channel attachment deferred until dotnet/arcade#16813 merges.

Asset list for build 314208:

File Size
dotnetup-win-x64.exe 14.4 MB
dotnetup-win-arm64.exe 15.0 MB
dotnetup-linux-x64 14.1 MB
dotnetup-linux-arm64 14.6 MB
dotnetup-linux-musl-x64 14.1 MB
dotnetup-linux-musl-arm64 14.6 MB
dotnetup-osx-x64 14.0 MB
dotnetup-osx-arm64 13.3 MB

(Plus matching .sha512 checksums.)

Companion changes

This PR is the fourth in a coordinated series:

# Change Status
1 maestro-configuration#61048 — create dotnetup Daily channel ✅ merged
2 dotnet/arcade#16813 — register channel publishing config (feeds + aka.ms patterns) open
3 maestro-configuration#61053 — default-channel mapping for dotnet/sdk@release/dnup → dotnetup Daily open
4 This PR open

If this PR merges before the arcade and default-channel-mapping PRs above, every CI build will register with BAR but no automatic publishing will happen — manual darc add-build-to-channel is the workaround. Once all four are merged, every CI build of release/dnup will auto-publish to ci.dot.net/public/dotnetup/<SemVer>/ and refresh the aka.ms/dotnet/dotnetup/daily/<file> shortlinks.

What's intentionally NOT in this PR

  • NuGet package routing through BAR (per Matt Mitchell's defense-in-depth recommendation): keeping the existing 1ES.PublishNuget@1 direct-push of Microsoft.Dotnet.Installation for now. Including it here would mean either a publishing gap (if direct push is removed before automatic promotion is wired up) or double-publish (if both run simultaneously). Better as a follow-up PR sequenced after auto-promotion is confirmed working end-to-end.
  • Switching the get-dotnetup.{sh,ps1} install scripts to anonymous URLs: the current scripts use az to download pipeline artifacts. Once builds are flowing to ci.dot.net/public/dotnetup/... and aka.ms/dotnet/dotnetup/daily/... links are live, those scripts can drop the az requirement. Follow-up PR.
  • v4 publishing pipeline migration — Matt offered to do this post-merge for ~20min savings on the staging job.

Adds a publish_to_bar stage to the dotnetup CI pipeline that runs on every non-PR build. The stage:

1. Downloads the per-RID dotnetup-standalone-* pipeline artifacts.

2. Stages all 16 binary/.sha512 files flat under BlobArtifacts/ (Arcade's PublishArtifactsInManifestBase fetches blobs by basename only) and emits a v3 MergedManifest.xml whose Blob Id paths (dotnetup/<SemVer>/<file>) are used as the upload destinations.

3. Calls publish-build-assets.yml (Arcade's standard job) to register the build with the Build Asset Registry.

Once dotnet/sdk@release/dnup is mapped as a default channel for 'dotnetup Daily' (maestro-configuration#61053) and the channel's TargetChannelConfig is registered (dotnet/arcade#16813), the Maestro Promotion Pipeline (dotnet#750) will publish each build's binaries to ci.dot.net/public/dotnetup/<SemVer>/ with stable aka.ms/dotnet/dotnetup/daily/<file> shortlinks.

Other changes:

- WriteDotnetupVersionFile (dotnetup.csproj): emits dotnetup.version.txt next to the published binary so the BAR staging job has an authoritative source for the Arcade-composed SemVer (no MSBuild file parsing in the pipeline).

- dotnetup-executables.yml: copies dotnetup.version.txt into each per-RID standalone artifact.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 14, 2026 11:01
@dsplaisted dsplaisted requested a review from a team as a code owner May 14, 2026 11:01
@dsplaisted dsplaisted added the dotnetup Work items around the proposed `dotnetup` bootstrapper/toolchain management tool and library label May 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Build Asset Registry (BAR) registration for non-PR release/dnup dotnetup builds by staging standalone executables/checksums into the expected BlobArtifacts/ layout, generating a v3 MergedManifest.xml, and invoking Arcade’s standard publish-build-assets job so Maestro can later promote/upload to channel-based blob feeds.

Changes:

  • Emit dotnetup.version.txt during dotnet publish so pipelines can consume the Arcade-computed $(Version) without parsing MSBuild files.
  • Include dotnetup.version.txt in each per-RID dotnetup-standalone-* pipeline artifact (Windows + Unix staging).
  • Add a new staging + BAR-registration job template and wire it into .vsts-dnup-ci.yml as a publish_to_bar stage for non-PR builds.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Installer/dotnetup/dotnetup.csproj Adds an MSBuild target to write dotnetup.version.txt into the publish output.
eng/pipelines/templates/jobs/dotnetup/dotnetup-publish-to-bar.yml New job template that downloads per-RID standalone artifacts, stages a flat BlobArtifacts/ layout, generates MergedManifest.xml, and runs Arcade BAR registration.
eng/pipelines/templates/jobs/dotnetup/dotnetup-executables.yml Updates per-RID staging to include dotnetup.version.txt in the standalone artifacts used by BAR staging.
.vsts-dnup-ci.yml Adds the publish_to_bar stage (non-PR) that depends on all per-RID executable stages and runs the BAR registration template.

Comment on lines +67 to +68
artifact: dotnetup-standalone-${{ entry.rid }}
path: $(Pipeline.Workspace)/standalone/${{ entry.rid }}
Comment on lines +14 to +28
isWindows: true
- rid: win-arm64
isWindows: true
- rid: linux-x64
isWindows: false
- rid: linux-arm64
isWindows: false
- rid: linux-musl-x64
isWindows: false
- rid: linux-musl-arm64
isWindows: false
- rid: osx-x64
isWindows: false
- rid: osx-arm64
isWindows: false
@dsplaisted dsplaisted marked this pull request as draft May 14, 2026 16:44
@dsplaisted
Copy link
Copy Markdown
Member Author

Marking draft while we evaluate an alternative approach. Per Matt's feedback on the email thread, exploring switching dotnetup to use standard Arcade primitives (build.cmd -pack -sign -publish with /p:Projects=dotnetup.slnf) instead of the bespoke pipeline this PR builds on. Will pick this back up depending on how that exploration goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dotnetup Work items around the proposed `dotnetup` bootstrapper/toolchain management tool and library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants