Skip to content

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

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#8
beyondnetPeru merged 1 commit into
mainfrom
fix/ci-publish-chain

Conversation

@beyondnetPeru

Copy link
Copy Markdown
Contributor

Closes #1, closes #2, closes #3, closes #4.

Root cause — worse than the issues described

While fixing the pack job I found the workflow has never executed. on: declared tags: as a top-level key:

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

tags is not a GitHub Actions event; it only exists nested under push. GitHub rejects the whole file, so:

  • all four runs to date failed in 0 seconds with "This run likely failed because of a workflow file issue"
  • the v1.0.0 tag produced no run at all
  • the test suite has never run in CI, on any commit

That is why the NuGet profile shows 0 packages. The src/ paths in #1 were real, but they were never even reached.

Fixes

# Fix
tags: ['v*'] moved under push: so tag pushes trigger the workflow
version job: dropped github.event_name == 'tag' — tag pushes arrive as push, so that clause never matched
#1 pack matrix points at the real project locations (repo root, not src/)
#2 -p:PackageVersion= replaces --version:, which is not a dotnet pack option
#3 --no-build dropped — the job runs on a fresh runner with nothing pre-built
matrix values are folder names, not paths: upload-artifact rejects artifact names containing /, so packages-src/Beyond…csproj would have failed even after #1
release now depends on publish, so a GitHub Release cannot appear for a version whose packages never reached NuGet
#4 workflow renamed CI / CDCI (the slash made the legacy badge URL ambiguous); README badge switched to the file-based form

Verification

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

dotnet build BeyondNet.Aop.sln -c Release   → 0 warnings, 0 errors
dotnet test  BeyondNet.Aop.sln -c Release   → 13/13 passed
dotnet pack  <each project> -p:PackageVersion=1.2.3-test

All six packages produced, each carrying the version in its filename and a populated lib/net10.0/:

BeyondNetCode.Shell.Aop.1.2.3-test.nupkg
BeyondNetCode.Shell.Aop.Aspects.1.2.3-test.nupkg
BeyondNetCode.Shell.Aop.Aspects.Logger.1.2.3-test.nupkg
BeyondNetCode.Shell.Aop.Aspects.Logger.Serilog.1.2.3-test.nupkg
BeyondNetCode.Shell.Aop.DispatchProxy.1.2.3-test.nupkg
BeyondNetCode.Shell.Aop.DI.1.2.3-test.nupkg

CI on this PR is the real proof: it is the first run this workflow has ever been able to attempt.

Before releasing

Two things this PR cannot do for you:

  1. NUGET_API_KEY must exist in the nuget-release environment, or publish fails at the last step.
  2. The v1.0.0 tag is stale — it points at a commit whose workflow could not run. Re-tag after merging (git tag -f v1.0.0 or, cleaner, cut v1.0.1) to trigger the first real publish.

Not touched

The release job generates notes from listCommits({since: '2024-01-01'}), a hardcoded date that will drift. Out of scope here — worth its own issue.

🤖 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: all four runs to date
failed in 0s with "workflow file issue", and the v1.0.0 tag never
triggered anything. Nothing has ever been built, tested or published.

Fixes, in order of impact:

- Move `tags: ['v*']` under `push:` so tag pushes trigger the workflow.
- `version` job: drop the `github.event_name == 'tag'` condition; tag
  pushes arrive as `push` events, so the extra clause never matched.
- `pack` matrix: point at the real project paths. The entries carried a
  `src/` prefix, but the projects live at the repo root.
- `pack`: use `-p:PackageVersion=` instead of `--version:`, which is not
  a `dotnet pack` option.
- `pack`: drop `--no-build`. The job runs on a fresh runner with no
  artifacts downloaded, so there is nothing pre-built to package.
- `pack`: matrix values are now folder names, not paths, because
  `upload-artifact` rejects artifact names containing "/".
- `release` now depends on `publish`, so a GitHub Release cannot appear
  for a version whose packages failed to reach NuGet.
- Rename the workflow `CI / CD` -> `CI`; the slash made the legacy badge
  URL ambiguous. README badge switched to the file-based form.

Verified locally on .NET 10.0.201:
- `dotnet build -c Release`: 0 warnings, 0 errors
- `dotnet test -c Release`: 13/13 passed
- `dotnet pack -p:PackageVersion=1.2.3-test`: all 6 packages produced,
  each carrying the version in its filename and a populated lib/net10.0/

Closes #1
Closes #2
Closes #3
Closes #4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant