[release/13.2] Fix Homebrew and WinGet publishing for stable artifact versions#15367
Conversation
Stable builds publish CLI archives under a preview version path on ci.dot.net (e.g. aspire/9.2.0-preview.1.12345/) while the tarball filename uses the real stable version (aspire-cli-osx-arm64-9.2.0.tar.gz). The old code assumed the same version appeared in both the URL path and filename. Introduce --artifact-version to generate-cask.sh so the URL path segment and the filename version can differ. Add --archive-root for computing SHA256 hashes from locally-built archives instead of downloading from ci.dot.net. Remove the --channel parameter and the separate aspire@prerelease.rb.template; only the stable aspire.rb template is used. Simplify dogfood.sh accordingly.
Add brew style --fix to auto-correct formatting before auditing. Detect whether the cask is new upstream by querying the GitHub API and run brew audit with --new when appropriate. Use HOMEBREW_NO_INSTALL_FROM_API=1 during install tests to ensure the local tap cask is used rather than the Homebrew API cache. Add proper cleanup traps for brew untap on exit. Make the install/uninstall test conditional via a runInstallTest parameter. Write a validation-summary.json artifact recording all check results so the publish step can verify that prepare-stage validation actually ran and passed.
Replace the gh CLI and git clone/push workflow with pure GitHub API calls via Invoke-RestMethod. This removes the need for a git installation on the build agent and avoids fork-clone race conditions. Key changes: - Fork Homebrew/homebrew-cask via API with polling for readiness - Create/reset the PR branch and upload the cask file via the contents API - Check whether upstream already has the exact same content and skip if so - Require a passing validation-summary.json before submitting - Create PRs as drafts; convert existing open PRs to draft via GraphQL - Generate a rich PR body with a checklist of all validation steps - Reference superseded closed PRs in the body when re-submitting
Apply the same artifactVersion split to the WinGet pipeline: the installer URL path uses the artifact version while the package version uses the real stable version. Update generate-manifests.ps1 and the prepare/publish templates accordingly.
Update the top-level pipeline files to pass artifactVersion instead of channel to the Homebrew and WinGet templates. Add the new installer preparation and publishing stages to the unofficial pipeline.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15367Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15367" |
There was a problem hiding this comment.
Pull request overview
This PR fixes stable installer publishing so Homebrew/WinGet flows can use an artifactVersion (ci.dot.net path segment) that differs from the final stable package version, improving reliability of URL resolution and submission automation in the release pipelines.
Changes:
- Add
artifactVersionplumbing through WinGet manifest generation/publishing and Homebrew cask generation/publishing. - Rework Homebrew publishing to use GitHub REST/GraphQL APIs (fork/branch/reset/update/PR) and require prepare-stage validation evidence before submitting.
- Adjust official/unofficial pipeline stages to compute and pass both stable package version and installer artifact version; add options to compute hashes from local archives.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/winget/README.md | Document artifact URL pattern using {ARTIFACT_VERSION}. |
| eng/winget/generate-manifests.ps1 | Add -ArtifactVersion and optional local-archive hashing for SHA256. |
| eng/testing/github-ci-trigger-patterns.txt | Treat eng/homebrew/** and eng/winget/** as CI-skip eligible changes. |
| eng/pipelines/templates/publish-winget.yml | Make WinGet submission more robust (clean submit dir, parse version from manifest, validate required files). |
| eng/pipelines/templates/publish-homebrew.yml | Remove channel handling (stable-only) and implement GitHub API–based PR submission gated by validation summary. |
| eng/pipelines/templates/prepare-winget-manifest.yml | Pass artifactVersion, optionally hash from downloaded archives, and gate install test. |
| eng/pipelines/templates/prepare-homebrew-cask.yml | Generate stable cask with artifactVersion, add style/audit/install validation, emit validation-summary.json, stable artifact name. |
| eng/pipelines/release-publish-nuget.yml | Support “installer-only” runs; wire updated publish-homebrew template without channel param. |
| eng/pipelines/azure-pipelines.yml | Compute stable version vs artifact version separately; condition installer prep by branch/channel; stable-only Homebrew job. |
| eng/pipelines/azure-pipelines-unofficial.yml | Mirror official installer prep changes and enable local-archive hashing (URLs/install tests optional). |
| eng/homebrew/README.md | Update docs for artifact URLs and publishing mechanics (needs follow-up to match stable-only removal of prerelease pieces). |
| eng/homebrew/generate-cask.sh | Add --artifact-version and --archive-root; hash either from remote URLs or local archives. |
| eng/homebrew/dogfood.sh | Restrict dogfood to stable cask and simplify uninstall/auto-detect logic. |
| eng/homebrew/aspire@prerelease.rb.template | Remove prerelease cask template. |
| eng/homebrew/aspire.rb.template | Use ${ARTIFACT_VERSION} in URL; formatting/metadata tweaks. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the release/13.2 release/installer publishing toolchain to correctly handle cases where the published package version (stable) differs from the artifact version used in ci.dot.net archive paths, and to make Homebrew/WinGet publishing more reliable.
Changes:
- Plumbs
artifactVersionthrough WinGet and Homebrew generation flows and updates URL templates to use{ARTIFACT_VERSION}in the archive path segment. - Improves WinGet publishing robustness (clean submission directory, stronger manifest validation) and Homebrew publishing reliability (GitHub REST/GraphQL-based fork/branch/PR flow).
- Adjusts release pipeline logic to support “installer-only” runs and to compute both stable version and installer artifact version distinctly.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/winget/README.md | Documents new ci.dot.net URL shape using {ARTIFACT_VERSION}. |
| eng/winget/generate-manifests.ps1 | Adds ArtifactVersion + ArchiveRoot support and updates URL/hash generation logic. |
| eng/testing/github-ci-trigger-patterns.txt | Updates GitHub CI trigger pattern list to include installer engineering dirs. |
| eng/pipelines/templates/publish-winget.yml | Copies manifests into a clean submission folder and adds stricter required-file checks. |
| eng/pipelines/templates/publish-homebrew.yml | Reworks Homebrew PR submission to use GitHub APIs and enforces prepare-stage validation summary. |
| eng/pipelines/templates/prepare-winget-manifest.yml | Wires artifactVersion, optional local archive hashing, and optional install test execution. |
| eng/pipelines/templates/prepare-homebrew-cask.yml | Generates stable cask with artifact-versioned URLs; adds style/audit/install validation + summary artifact. |
| eng/pipelines/release-publish-nuget.yml | Supports installer-only mode by skipping NuGet steps and creating placeholders when needed. |
| eng/pipelines/azure-pipelines.yml | Computes stable version + installer artifact version separately; restricts stable installer prep to main/release branches; forces clean checkout. |
| eng/pipelines/azure-pipelines-unofficial.yml | Mirrors official pipeline’s installer version + artifact-version computation and wiring; forces clean checkout. |
| eng/homebrew/README.md | Updates Homebrew docs for artifact-versioned URLs, REST API publishing flow, and current validation steps. |
| eng/homebrew/generate-cask.sh | Removes channel selection; adds --artifact-version and optional --archive-root hashing. |
| eng/homebrew/dogfood.sh | Simplifies to stable-only cask and updates install/uninstall preflight checks accordingly. |
| eng/homebrew/aspire@prerelease.rb.template | Removes prerelease cask template (stable-only publishing path). |
| eng/homebrew/aspire.rb.template | Updates URL to use ${ARTIFACT_VERSION} placeholder and tweaks metadata text/formatting. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
joperezr
left a comment
There was a problem hiding this comment.
Looks good to me. Since you removed aspire@prerelease template, can we check real quick on docs etc to make sure we don't have references to it?
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… versions (#15367) * Add installer paths to CI trigger patterns * Replace channel with artifactVersion in Homebrew cask generation Stable builds publish CLI archives under a preview version path on ci.dot.net (e.g. aspire/9.2.0-preview.1.12345/) while the tarball filename uses the real stable version (aspire-cli-osx-arm64-9.2.0.tar.gz). The old code assumed the same version appeared in both the URL path and filename. Introduce --artifact-version to generate-cask.sh so the URL path segment and the filename version can differ. Add --archive-root for computing SHA256 hashes from locally-built archives instead of downloading from ci.dot.net. Remove the --channel parameter and the separate aspire@prerelease.rb.template; only the stable aspire.rb template is used. Simplify dogfood.sh accordingly. * Harden Homebrew prepare-stage validation Add brew style --fix to auto-correct formatting before auditing. Detect whether the cask is new upstream by querying the GitHub API and run brew audit with --new when appropriate. Use HOMEBREW_NO_INSTALL_FROM_API=1 during install tests to ensure the local tap cask is used rather than the Homebrew API cache. Add proper cleanup traps for brew untap on exit. Make the install/uninstall test conditional via a runInstallTest parameter. Write a validation-summary.json artifact recording all check results so the publish step can verify that prepare-stage validation actually ran and passed. * Rewrite Homebrew publish to use GitHub REST and GraphQL API Replace the gh CLI and git clone/push workflow with pure GitHub API calls via Invoke-RestMethod. This removes the need for a git installation on the build agent and avoids fork-clone race conditions. Key changes: - Fork Homebrew/homebrew-cask via API with polling for readiness - Create/reset the PR branch and upload the cask file via the contents API - Check whether upstream already has the exact same content and skip if so - Require a passing validation-summary.json before submitting - Create PRs as drafts; convert existing open PRs to draft via GraphQL - Generate a rich PR body with a checklist of all validation steps - Reference superseded closed PRs in the body when re-submitting * Improve WinGet manifest generation and publishing Apply the same artifactVersion split to the WinGet pipeline: the installer URL path uses the artifact version while the package version uses the real stable version. Update generate-manifests.ps1 and the prepare/publish templates accordingly. * Wire up artifactVersion in release and CI pipelines Update the top-level pipeline files to pass artifactVersion instead of channel to the Homebrew and WinGet templates. Add the new installer preparation and publishing stages to the unofficial pipeline. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Address installer publishing review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * [release/13.2] Fix Homebrew publish URI escaping Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
This updates the installer publishing flow on
release/13.2with three related fixes:The main motivation is to make stable installer publishing resolve the correct artifact URLs even when the archive path uses an artifact version that differs from the final stable package version. The pipeline wiring now passes
artifactVersionthrough the Homebrew and WinGet flows, and the Homebrew publishing path is updated to use the GitHub APIs for a more reliable publish flow.Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: