Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/purview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -100,6 +114,33 @@ 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:
INPUT_ASPIRE_CLI_VERSION: ${{ inputs.aspire-cli-version }}
run: |
set -euo pipefail

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" \
|| 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`
Expand Down
22 changes: 22 additions & 0 deletions docs/wiki/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions skills/purview-build-adoption/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading