Skip to content

Commit 4634b67

Browse files
fix(ci): repair the publish chain so the workflow can actually run (#3)
`tags:` was a top-level key under `on:`, which is not a valid event, so GitHub rejected the workflow outright — every run in this repo's history failed in 0s and the 5 tests had never executed in CI. - Move `tags: ['v*']` under `push:`; drop the bogus `'tag'` event check - Point the pack matrix at the real project paths (root, not `src/`) - Use `-p:PackageVersion=` instead of the invalid `--version:` - Drop `--no-build` on a fresh runner; use folder names for artifact names - Make `release` depend on `publish` - Rename `CI / CD` -> `CI` and fix the README badge URL Verified locally: build clean, 5/5 tests, all 4 packages produced.
1 parent 8a3dcc0 commit 4634b67

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
name: CI / CD
1+
name: CI
22

33
on:
44
push:
55
branches: [main, develop]
6+
tags: ['v*']
67
pull_request:
78
branches: [main, develop]
8-
tags:
9-
- 'v*'
109

1110
env:
1211
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
@@ -59,7 +58,7 @@ jobs:
5958
name: Determine Version
6059
runs-on: ubuntu-latest
6160
needs: build-and-test
62-
if: github.event_name == 'push' || github.event_name == 'tag'
61+
if: github.event_name == 'push'
6362
outputs:
6463
version: ${{ steps.version.outputs.version }}
6564
is_release: ${{ steps.version.outputs.is_release }}
@@ -89,11 +88,13 @@ jobs:
8988
if: needs.version.outputs.is_release == 'true'
9089
strategy:
9190
matrix:
91+
# Folder and assembly name match, so one value drives both the csproj
92+
# path and the artifact name (artifact names cannot contain "/").
9293
project:
93-
- src/BeyondNetCode.Shell.Bootstrapper/BeyondNetCode.Shell.Bootstrapper.csproj
94-
- src/BeyondNetCode.Shell.Bootstrapper.DependencyInjection/BeyondNetCode.Shell.Bootstrapper.DependencyInjection.csproj
95-
- src/BeyondNetCode.Shell.Bootstrapper.AutoMapper/BeyondNetCode.Shell.Bootstrapper.AutoMapper.csproj
96-
- src/BeyondNetCode.Shell.Bootstrapper.Observability/BeyondNetCode.Shell.Bootstrapper.Observability.csproj
94+
- BeyondNetCode.Shell.Bootstrapper
95+
- BeyondNetCode.Shell.Bootstrapper.DependencyInjection
96+
- BeyondNetCode.Shell.Bootstrapper.AutoMapper
97+
- BeyondNetCode.Shell.Bootstrapper.Observability
9798
steps:
9899
- uses: actions/checkout@v4
99100

@@ -104,10 +105,9 @@ jobs:
104105

105106
- name: Pack
106107
run: |
107-
dotnet pack "${{ matrix.project }}" \
108+
dotnet pack "${{ matrix.project }}/${{ matrix.project }}.csproj" \
108109
-c Release \
109-
--version:${{ needs.version.outputs.version }} \
110-
--no-build \
110+
-p:PackageVersion=${{ needs.version.outputs.version }} \
111111
-p:PackageOutputPath=${{ github.workspace }}/nupkgs
112112
113113
- name: Upload artifacts
@@ -150,7 +150,7 @@ jobs:
150150
release:
151151
name: Create GitHub Release
152152
runs-on: ubuntu-latest
153-
needs: [version]
153+
needs: [version, publish]
154154
if: needs.version.outputs.is_release == 'true'
155155
steps:
156156
- uses: actions/checkout@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<img src="https://img.shields.io/badge/NuGet-BeyondNetCode-blue" alt="NuGet" />
1212
</a>
1313
<a href="https://github.com/beyondnetcode/Shell.Bootstrapper/actions">
14-
<img src="https://github.com/beyondnetcode/Shell.Bootstrapper/workflows/CI%20/%20CD/badge.svg" alt="Build" />
14+
<img src="https://github.com/beyondnetcode/Shell.Bootstrapper/actions/workflows/build.yml/badge.svg" alt="Build" />
1515
</a>
1616
</p>
1717
</div>

0 commit comments

Comments
 (0)