Skip to content

fix(ci): repair the publish chain so the workflow can actually run - #2

Merged
beyondnetPeru merged 1 commit into
mainfrom
fix/ci-publish-chain
Aug 3, 2026
Merged

fix(ci): repair the publish chain so the workflow can actually run#2
beyondnetPeru merged 1 commit into
mainfrom
fix/ci-publish-chain

Conversation

@beyondnetPeru

Copy link
Copy Markdown
Contributor

Same workflow defect as beyondnetcode/Shell.Aop#8 (already merged and green), plus two packaging bugs unique to this repo that made dotnet pack fail outright.

Root cause 1 — the workflow was never valid

on: declared tags: as a top-level key, which is not a GitHub Actions event:

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main, develop]
  tags:          # <- not a valid event
    - 'v*'

GitHub rejects the whole file. Every run in this repo's history failed in 0 seconds with "This run likely failed because of a workflow file issue" — the 58 tests in this repo have never run on any commit.

Root cause 2 — pack failed before producing anything

Two bugs in the .csproj files, both invisible until the workflow could actually run:

  1. NU5019 — file not found. Every project referenced ../../LICENSE and ../../README.md (../../../ in one case), paths that assume a src/<project>/ layout. The projects live at the repo root, so those paths resolve outside the repository. Corrected to ../.

  2. NU5030 — license file not in the package. <PackagePath>LICENSE</PackagePath> has no file extension, so NuGet treats it as a directory: the file landed at LICENSE/LICENSE while <PackageLicenseFile>LICENSE</PackageLicenseFile> looked for it at the root. Corrected to <PackagePath>/</PackagePath>, which places the file at the package root under its own name. README.md was unaffected because its extension made NuGet read it as a file path.

Worth noting: the same LICENSE/LICENSE misplacement exists in Shell.Factory and is fixed in its parallel PR. Shell.Aop and Shell.Bootstrapper are unaffected — they use PackageLicenseExpression instead of a packed file.

Workflow fixes

  • tags: ['v*'] moved under push:
  • version job: dropped github.event_name == 'tag' — tag pushes arrive as push
  • pack matrix points at the real project locations (repo root, not src/)
  • -p:PackageVersion= replaces --version:, which is not a dotnet pack option
  • --no-build dropped; the job runs on a fresh runner with nothing pre-built
  • matrix values are folder names — upload-artifact rejects names containing /
  • release now depends on publish
  • workflow renamed CI / CDCI; README badge switched to the file-based URL

Verification

Locally on .NET 10.0.201 (matching global.json):

dotnet build BeyondNet.Ddd.slnx -c Release  → 0 errors (15 warnings)
dotnet test  BeyondNet.Ddd.slnx -c Release  → 58/58 passed
dotnet pack  <each of the 3 matrix projects> -p:PackageVersion=9.9.9-test

All three packages produced, each with lib/net10.0/, and LICENSE + README.md at the package root — verified with unzip -l.

Before releasing

NUGET_API_KEY must exist in the nuget-release environment, or publish fails at the last step.

🤖 Generated with Claude Code

The workflow declared `tags:` as a top-level key under `on:`, which is not
a valid event. GitHub rejected the file outright: every run in this repo's
history failed in 0s with "workflow file issue". CI has never executed and
the tests have never run on any commit.

- Move `tags: ['v*']` under `push:` so tag pushes trigger the workflow
- Drop the `github.event_name == 'tag'` clause; tag pushes are `push`
- Point the pack matrix at the real project paths (root, not `src/`)
- Use `-p:PackageVersion=` instead of the invalid `--version:`
- Drop `--no-build`; the pack job runs on a fresh runner
- Use folder names in the matrix; artifact names cannot contain "/"
- Make `release` depend on `publish`
- Rename `CI / CD` -> `CI` and switch the README badge to the file-based URL

Verified locally on .NET 10.0.201: build clean, 58/58 tests passing,
and every matrix project packs with the version in its filename.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@beyondnetPeru
beyondnetPeru merged commit 4d95387 into main Aug 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant