From ff58bdb0a87245908030ce3a4fc749245472e86d Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Wed, 18 Nov 2026 22:55:58 +0000 Subject: [PATCH 1/2] feat: aspire cli support --- .github/workflows/purview-build.yml | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/purview-build.yml b/.github/workflows/purview-build.yml index 210f37c..11c1257 100644 --- a/.github/workflows/purview-build.yml +++ b/.github/workflows/purview-build.yml @@ -64,6 +64,20 @@ on: its documented probe order starting at the repository root. required: false type: string + aspire-cli: + description: >- + Install the Aspire CLI and run `aspire setup` before the build. Required by an AppHost that + uses Microsoft.NET.Sdk with Aspire.Hosting.AppHost 17, where ASPIRE013 makes the CLI bundle a + hard build requirement that cannot be suppressed. + required: false + default: false + type: boolean + aspire-cli-version: + description: >- + Aspire CLI version to install. When omitted, it is read from the consuming repository's + `.config/aspire-version`, so the repository pins the CLI rather than the workflow. + required: false + type: string secrets: NUGET_APIKEY: required: false @@ -100,6 +114,31 @@ jobs: with: dotnet-version: ${{ inputs.dotnet-version }} + # The CLI installs the DCP/dashboard bundle the AppHost's Aspire.Hosting package selects, so the + # version is the consuming repository's pin, not a floating default. Installed after the SDK + # because it is a dotnet global tool and before the build because ASPIRE013 fails without it. + - name: Install Aspire CLI + if: inputs.aspire-cli + shell: bash + env: + ASPIRE_CLI_VERSION: ${{ inputs.aspire-cli-version }} + run: | + set -euo pipefail + + if [ -z "$ASPIRE_CLI_VERSION" ]; then + if [ ! -f .config/aspire-version ]; then + echo "::error title=Aspire CLI version unknown::aspire-cli was enabled, but .config/aspire-version does not exist and no aspire-cli-version input was supplied." + exit 1 + fi + ASPIRE_CLI_VERSION="$(tr -d '[:space:]' < .config/aspire-version)" + fi + + dotnet tool install --global Aspire.Cli --version "$ASPIRE_CLI_VERSION" \ + || dotnet tool update --global Aspire.Cli --version "$ASPIRE_CLI_VERSION" + echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH" + "$HOME/.dotnet/tools/aspire" setup + "$HOME/.dotnet/tools/aspire" --version + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 # JavaScript tooling (Astro and anything it shells out to) checks `process.versions.node` From 7ab0058364d80f94a5b0382625a5bddc98251545 Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Wed, 18 Nov 2026 22:58:38 +0000 Subject: [PATCH 2/2] fix(build): guard the aspire-cli-version input WorkflowParityTests requires every optional workflow input that is referenced to sit behind a non-empty guard, and recognises that guard as `[ -n "$INPUT_" ]`. Mapping the input to a plain ASPIRE_CLI_VERSION was invisible to that rule, so the parity check failed even though the workflow behaved correctly. Name the variable INPUT_ASPIRE_CLI_VERSION and test it directly. Document the input where a consumer looks: the reusable-workflow setup page and the adoption skill, including that actions/purview-release declares no such input and a release caller installs the CLI itself. --- .github/workflows/purview-build.yml | 6 ++++-- docs/wiki/Getting-Started.md | 22 ++++++++++++++++++++++ skills/purview-build-adoption/SKILL.md | 19 +++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/.github/workflows/purview-build.yml b/.github/workflows/purview-build.yml index 11c1257..304b30b 100644 --- a/.github/workflows/purview-build.yml +++ b/.github/workflows/purview-build.yml @@ -121,16 +121,18 @@ jobs: if: inputs.aspire-cli shell: bash env: - ASPIRE_CLI_VERSION: ${{ inputs.aspire-cli-version }} + INPUT_ASPIRE_CLI_VERSION: ${{ inputs.aspire-cli-version }} run: | set -euo pipefail - if [ -z "$ASPIRE_CLI_VERSION" ]; then + if [ -z "$INPUT_ASPIRE_CLI_VERSION" ]; then if [ ! -f .config/aspire-version ]; then echo "::error title=Aspire CLI version unknown::aspire-cli was enabled, but .config/aspire-version does not exist and no aspire-cli-version input was supplied." exit 1 fi ASPIRE_CLI_VERSION="$(tr -d '[:space:]' < .config/aspire-version)" + else + ASPIRE_CLI_VERSION="$INPUT_ASPIRE_CLI_VERSION" fi dotnet tool install --global Aspire.Cli --version "$ASPIRE_CLI_VERSION" \ diff --git a/docs/wiki/Getting-Started.md b/docs/wiki/Getting-Started.md index f2ce541..24f2692 100644 --- a/docs/wiki/Getting-Started.md +++ b/docs/wiki/Getting-Started.md @@ -9,6 +9,28 @@ Mixing a pinned old `@ref` with a floating `build-version` runs newer tool code through older workflow inputs. +## Aspire AppHosts + +An AppHost built with `Microsoft.NET.Sdk` plus `Aspire.Hosting.AppHost` 17 needs the Aspire CLI before +it builds: ASPIRE013 makes the CLI bundle a hard build requirement and cannot be suppressed. Enable +`aspire-cli` and the shared workflow installs `Aspire.Cli` from the repository's +`.config/aspire-version`, runs `aspire setup`, and puts the tool on `PATH` before the build. + +```yaml + build: + uses: purview-dev/build/.github/workflows/purview-build.yml@main + with: + aspire-cli: true + secrets: inherit +``` + +The version comes from `.config/aspire-version`, so the repository pins the CLI beside the +`Aspire.Hosting.AppHost` version it resolves — a mismatch builds against a bundle the AppHost never +selected. `aspire-cli-version` overrides the file for a one-off. + +The composite action has no such input: a release caller that builds these AppHosts installs the +pinned CLI itself before `actions/purview-release` runs. + ## Minimal repository setup (reusable workflow) ```yaml diff --git a/skills/purview-build-adoption/SKILL.md b/skills/purview-build-adoption/SKILL.md index 5aaef5b..a8e701f 100644 --- a/skills/purview-build-adoption/SKILL.md +++ b/skills/purview-build-adoption/SKILL.md @@ -46,6 +46,25 @@ jobs: secrets: inherit ``` +### Aspire AppHosts + +An AppHost on `Microsoft.NET.Sdk` + `Aspire.Hosting.AppHost` 17 needs the Aspire CLI before it builds; +ASPIRE013 cannot be suppressed. Add `aspire-cli: true` to the `with:` block: + +```yaml + with: + aspire-cli: true +``` + +The workflow installs `Aspire.Cli` from the repository's `.config/aspire-version` (so the pin sits +beside the `Aspire.Hosting.AppHost` version the AppHost resolves), runs `aspire setup`, and puts the +tool on `PATH` before the build. `aspire-cli-version` overrides the file. A repository on the +`Aspire.AppHost.Sdk` 13.6 form needs nothing — keep it that way, and do not set +`AspireUseCliBundle=false` on a 17 AppHost. + +`actions/purview-release` declares no `aspire-cli` input: a release caller that builds these AppHosts +installs the pinned CLI itself before the action runs, as `aspire-resourcekit` does. + ## Release — the composite action Release runs as a **composite action**, not a reusable workflow. nuget.org validates the OIDC