From 16b24535be8a34130f04f32915c3037a5e0b31ac Mon Sep 17 00:00:00 2001 From: Alberto Arroyo Raygada Date: Mon, 3 Aug 2026 12:03:33 -0500 Subject: [PATCH] fix(ci): repair the publish chain so the workflow can actually run 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 --- .github/workflows/build.yml | 28 ++++++++++++++-------------- README.md | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eec8a40..461af94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,11 @@ -name: CI / CD +name: CI on: push: branches: [main, develop] + tags: ['v*'] pull_request: branches: [main, develop] - tags: - - 'v*' env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true @@ -59,7 +58,7 @@ jobs: name: Determine Version runs-on: ubuntu-latest needs: build-and-test - if: github.event_name == 'push' || github.event_name == 'tag' + if: github.event_name == 'push' outputs: version: ${{ steps.version.outputs.version }} is_release: ${{ steps.version.outputs.is_release }} @@ -89,13 +88,15 @@ jobs: if: needs.version.outputs.is_release == 'true' strategy: matrix: + # Project folder and assembly name match, so one value drives both the + # csproj path and the artifact name (artifact names cannot contain "/"). project: - - src/BeyondNetCode.Shell.Aop/BeyondNetCode.Shell.Aop.csproj - - src/BeyondNetCode.Shell.Aop.Aspects/BeyondNetCode.Shell.Aop.Aspects.csproj - - src/BeyondNetCode.Shell.Aop.Aspects.Logger/BeyondNetCode.Shell.Aop.Aspects.Logger.csproj - - src/BeyondNetCode.Shell.Aop.Aspects.Logger.Serilog/BeyondNetCode.Shell.Aop.Aspects.Logger.Serilog.csproj - - src/BeyondNetCode.Shell.Aop.DispatchProxy/BeyondNetCode.Shell.Aop.DispatchProxy.csproj - - src/BeyondNetCode.Shell.Aop.DI/BeyondNetCode.Shell.Aop.DI.csproj + - BeyondNetCode.Shell.Aop + - BeyondNetCode.Shell.Aop.Aspects + - BeyondNetCode.Shell.Aop.Aspects.Logger + - BeyondNetCode.Shell.Aop.Aspects.Logger.Serilog + - BeyondNetCode.Shell.Aop.DispatchProxy + - BeyondNetCode.Shell.Aop.DI steps: - uses: actions/checkout@v4 @@ -106,10 +107,9 @@ jobs: - name: Pack run: | - dotnet pack "${{ matrix.project }}" \ + dotnet pack "${{ matrix.project }}/${{ matrix.project }}.csproj" \ -c Release \ - --version:${{ needs.version.outputs.version }} \ - --no-build \ + -p:PackageVersion=${{ needs.version.outputs.version }} \ -p:PackageOutputPath=${{ github.workspace }}/nupkgs - name: Upload artifacts @@ -152,7 +152,7 @@ jobs: release: name: Create GitHub Release runs-on: ubuntu-latest - needs: [version] + needs: [version, publish] if: needs.version.outputs.is_release == 'true' steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index 376083a..547ef73 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ NuGet - Build + Build