Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ updates:

# The composite action is a separate manifest location as far as Dependabot is concerned.
- package-ecosystem: github-actions
directory: "/.github/actions/purview-build"
directory: "/actions/purview-build"
schedule:
interval: weekly
open-pull-requests-limit: 3
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ This file is the primary instruction set for human and AI agents working in this

## What this repository is

`Purview.Build` is the shared build/test/release system for the `purview-dev` organisation: a Generalized Modular Pipelines pipeline, packaged as a pinned .NET tool (`src/Purview.Build`) and exposed through a GitHub composite action (`.github/actions/purview-build`) and thin reusable workflows (`.github/workflows/purview-build.yml`, `purview-release.yml`). Consuming repositories own configuration (`purview-build.json`); they do not own pipeline code.
`Purview.Build` is the shared build/test/release system for the `purview-dev` organisation: a Generalized Modular Pipelines pipeline, packaged as a pinned .NET tool (`src/Purview.Build`) and exposed through a GitHub composite action (`actions/purview-build`) and thin reusable workflows (`.github/workflows/purview-build.yml`, `purview-release.yml`). Consuming repositories own configuration (`purview-build.json`); they do not own pipeline code.

## Repository layout

- `src/src/Build/` — the dotnet tool (the pipeline, package `Purview.Build`): `Program.cs`, `Modules/`, `Settings/`, `Helpers/`, `Configuration/`, `Release/`, `Version/`, `appsettings.json` (tool defaults).
- `src/tests/Build.UnitTests/` and `src/tests/Build.IntegrationTests/` — the test suites. TUnit categories come from the project-name suffix (the Purview SDK emits an assembly-level `[Category]`), so **never write a `[Category]` attribute by hand**: put a test in the project whose name carries the category you want.
- `src/tests/fixtures/` — the declarative scenario matrices (`eligibility-scenarios.json`, `config-resolution-scenarios.json`) and the `release-explain` golden file. These drive both the TUnit suites and the `just` CLI matrices; a new rule or probe location means appending cases here, not writing test code.
- `src/tests/scenarios/` — the shell runners behind `just release-matrix` / `just config-matrix`.
- `.github/actions/purview-build/` and `.github/workflows/` — the shared build action and the reusable workflows.
- `actions/purview-build/` and `.github/workflows/` — the shared build action and the reusable workflows.
- `actions/purview-release/` — the one release implementation, a composite action. It must be a
composite action rather than a reusable workflow: nuget.org validates the OIDC
`job_workflow_ref` claim against the Trusted Publishing policy, and inside a called workflow that
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ Consuming repositories own configuration; they do not own pipeline source code.
The same implementation is available three ways:

1. **`Purview.Build` dotnet tool** — NuGet package published to nuget.org. Run anywhere a .NET SDK exists (locally via `just`, in GitHub Actions, or another CI service).
2. **Composite actions** `purview-dev/build/.github/actions/purview-build` (build) and
2. **Composite actions** `purview-dev/build/actions/purview-build` (build) and
`purview-dev/build/actions/purview-release` (release) — for repositories that want the pipeline
embedded directly in one of their own jobs. Release must use the action, not a reusable workflow,
because Trusted Publishing only matches the caller's own workflow file.
embedded directly in one of their own jobs. Both live under `actions/`, never `.github/actions/`:
a cross-repository reference into that path cannot be resolved, and every job using one fails at
"Set up job" with a missing `action.yml` that is plainly present in the tree (see Architecture).
Release must use the action, not a reusable workflow, because Trusted Publishing only matches the
caller's own workflow file.
3. **Reusable workflows** `purview-dev/build/.github/workflows/purview-build.yml` and
`.../purview-release.yml` — thin `workflow_call` wrappers with structured inputs/secrets. The
release workflow forwards to the action above and cannot use Trusted Publishing.
Expand Down Expand Up @@ -164,7 +167,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: purview-dev/build/.github/actions/purview-build@main
- uses: purview-dev/build/actions/purview-build@main
env:
Build__TestFilter: "/*/*/*/*[Category=Unit]"
```
Expand Down
16 changes: 12 additions & 4 deletions docs/wiki/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The implementation is the generalized `PipelineCLI` that originated in `sourcege

The repository additionally exposes:

- a **composite action** (`.github/actions/purview-build`) that installs a pinned `Purview.Build` version and runs it, for repositories embedding the build in their own jobs, and
- a **composite action** (`actions/purview-build`) that installs a pinned `Purview.Build` version and runs it, for repositories embedding the build in their own jobs, and
- a **composite action** for release (`actions/purview-release`) plus two **reusable workflows** (`purview-build.yml`, `purview-release.yml`) that wrap that logic with structured inputs/secrets, reducing a consumer to one `uses:` step plus `purview-build.json`. Release has to be the composite action: Trusted Publishing validates the caller's own workflow file, which a called workflow can never be.

An MSBuild SDK remains a possible future companion for shared compile-time properties, analyzers, or package metadata. It should not own CI orchestration.
Expand Down Expand Up @@ -106,15 +106,23 @@ The shared CI surface is three documents plus two helper actions, all in this re
| --- | --- |
| `.github/workflows/purview-build.yml` | Reusable PR/build workflow |
| `.github/workflows/purview-release.yml` | Reusable release workflow (evaluates eligibility, runs the pipeline, prunes the mirror) |
| `.github/actions/purview-build/action.yml` | Composite action for callers that need surrounding steps |
| `actions/purview-build/action.yml` | Composite action for callers that need surrounding steps |
| `actions/nuget-sources/` | Registers nuget.org + the organisation GitHub Packages feed in the user-level NuGet configuration, with `%GITHUB_TOKEN%` credentials, and restores it on cleanup |
| `actions/prune-github-packages/` | Deletes older versions of the repository's packages from the mirror after a successful release |

The source configuration is implemented once and reused by every entry point. It runs **before** the
`Purview.Build` tool install, so a pinned `build-version` that exists only on GitHub Packages is
resolvable (and before the repository's first restore). This repository dogfoods both helper actions
from `./.github/actions/...` in `ci.yml`/`release.yml`; consumers get them from
`purview-dev/build/...@main`.
from `./actions/...` in `ci.yml`/`release.yml`; consumers get them from
`purview-dev/build/actions/...@main`.

**Every action lives under `actions/`, never `.github/actions/`.** A cross-repository reference into a
`.github/actions/` path does not resolve: the runner downloads the action repository and then fails the
job at "Set up job" with *"Can't find 'action.yml', 'action.yaml' or 'Dockerfile' for action
'purview-dev/build/.github/actions/<name>@main'"*, even though the manifest is present in the tree at
the resolved SHA. `actions/purview-build` moved there for that reason; do not move it back. GitHub's
own directories — `.github/workflows/` — are only ever referenced for the reusable workflows, where
the path form is `owner/repo/.github/workflows/<file>@ref` and is supported.

A reusable workflow cannot discover the ref it was invoked at (`uses:` does not accept expressions),
so the helper actions are referenced at `@main`. A consumer that pins the reusable workflow to an old
Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: purview-dev/build/.github/actions/purview-build@main
- uses: purview-dev/build/actions/purview-build@main
env:
Build__TestFilter: "/*/*/*/*[Category=Unit]"
```
Expand Down
4 changes: 2 additions & 2 deletions docs/wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Consuming repositories own configuration (`purview-build.json`); they do not own
The same implementation is available three ways:

1. **`Purview.Build` dotnet tool** — NuGet package published to nuget.org. Run anywhere a .NET SDK exists (locally via `just`, in GitHub Actions, or another CI service).
2. **Composite actions** `purview-dev/build/.github/actions/purview-build` (build) and
2. **Composite actions** `purview-dev/build/actions/purview-build` (build) and
`purview-dev/build/actions/purview-release` (release) — for repositories that want the pipeline
embedded directly in one of their own jobs. Release must use the action: Trusted Publishing
validates the caller's own workflow file.
Expand Down Expand Up @@ -57,7 +57,7 @@ CleanArtifacts ─┬→ Version ─┬─────────────
| Path | Purpose |
| --- | --- |
| `src/src/Build` | The packable `Purview.Build` tool: `Program.cs`, `Modules/`, `Settings/`, `Helpers/`, `appsettings.json` |
| `.github/actions/purview-build` | The shared composite action |
| `actions/purview-build` | The shared composite action |
| `.github/workflows` | The reusable `purview-build.yml`/`purview-release.yml` and this repository's own `ci.yml`/`release.yml` |
| `docs/wiki` | This wiki |
| `purview-build.json` | This repository's own pipeline configuration (the tool dogfoods itself) |
Expand Down
2 changes: 1 addition & 1 deletion skills/purview-build-adoption/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: purview-dev/build/.github/actions/purview-build@main
- uses: purview-dev/build/actions/purview-build@main
env:
Build__TestFilter: "/*/*/*/*[Category=Unit]"
```
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Build.UnitTests/NuGetSourceSetupTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class NuGetSourceSetupTests
const string ReleaseAction = "actions/purview-release/action.yml";
const string SelfHostedBuild = ".github/workflows/ci.yml";
const string SelfHostedRelease = ".github/workflows/release.yml";
const string CompositeAction = ".github/actions/purview-build/action.yml";
const string CompositeAction = "actions/purview-build/action.yml";

[Test]
public async Task SourceAction_RegistersNuGetOrgAndTheOrganisationFeed()
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Build.UnitTests/WorkflowParityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public partial class WorkflowParityTests
".github/workflows/purview-build.yml",
".github/workflows/purview-release.yml",
".github/workflows/release.yml",
".github/actions/purview-build/action.yml",
"actions/purview-build/action.yml",
"actions/purview-release/action.yml",
];

Expand Down
Loading