diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 63c464b..86d0966 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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 diff --git a/AGENTS.md b/AGENTS.md index f4f301b..9600b9b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ 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 @@ -12,7 +12,7 @@ This file is the primary instruction set for human and AI agents working in this - `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 diff --git a/README.md b/README.md index b3efaa7..1018147 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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]" ``` diff --git a/.github/actions/purview-build/action.yml b/actions/purview-build/action.yml similarity index 100% rename from .github/actions/purview-build/action.yml rename to actions/purview-build/action.yml diff --git a/docs/wiki/Architecture.md b/docs/wiki/Architecture.md index 744aa31..1f2f99f 100644 --- a/docs/wiki/Architecture.md +++ b/docs/wiki/Architecture.md @@ -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. @@ -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/@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/@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 diff --git a/docs/wiki/Getting-Started.md b/docs/wiki/Getting-Started.md index 24f2692..f130487 100644 --- a/docs/wiki/Getting-Started.md +++ b/docs/wiki/Getting-Started.md @@ -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]" ``` diff --git a/docs/wiki/Home.md b/docs/wiki/Home.md index a43b7c9..d8aebb4 100644 --- a/docs/wiki/Home.md +++ b/docs/wiki/Home.md @@ -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. @@ -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) | diff --git a/skills/purview-build-adoption/SKILL.md b/skills/purview-build-adoption/SKILL.md index a8e701f..1b3a9e9 100644 --- a/skills/purview-build-adoption/SKILL.md +++ b/skills/purview-build-adoption/SKILL.md @@ -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]" ``` diff --git a/src/tests/Build.UnitTests/NuGetSourceSetupTests.cs b/src/tests/Build.UnitTests/NuGetSourceSetupTests.cs index 0a0a3bc..c61b60b 100644 --- a/src/tests/Build.UnitTests/NuGetSourceSetupTests.cs +++ b/src/tests/Build.UnitTests/NuGetSourceSetupTests.cs @@ -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() diff --git a/src/tests/Build.UnitTests/WorkflowParityTests.cs b/src/tests/Build.UnitTests/WorkflowParityTests.cs index b14a729..b1b68c6 100644 --- a/src/tests/Build.UnitTests/WorkflowParityTests.cs +++ b/src/tests/Build.UnitTests/WorkflowParityTests.cs @@ -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", ];