Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 17 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,20 @@ jobs:
new_version: ${{ steps.tag_bump.outputs.new_tag }}

publish:
needs: generate-version
runs-on: ubuntu-latest
strategy:
matrix:
project:
- name: Blake.Types
path: src/Blake.Types/Blake.Types.csproj
- name: Blake.MarkdownParser
path: src/Blake.MarkdownParser/Blake.MarkdownParser.csproj
- name: Blake.BuildTools
path: src/Blake.BuildTools/Blake.BuildTools.csproj
- name: Blake.CLI
path: src/Blake.CLI/Blake.CLI.csproj
steps:
- name: Publish
uses: ./.github/workflows/reusable-publish.yml@main
with:
project_path: ${{ matrix.project.path }}
version: ${{ needs.generate-version.outputs.new_version }}
nuget_key: ${{ secrets.NUGET_API_KEY }}
uses: ./.github/workflows/reusable-publish.yml
with:
project_path: ${{ matrix.project.path }}
version: ${{ needs.generate-version.outputs.new_version }}
secrets: inherit
needs: generate-version
Comment on lines +74 to +78
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The needs dependency should be moved to the job level, not inside the job definition. It should be at the same indentation level as uses and with.

Suggested change
with:
project_path: ${{ matrix.project.path }}
version: ${{ needs.generate-version.outputs.new_version }}
secrets: inherit
needs: generate-version
needs: generate-version
with:
project_path: ${{ matrix.project.path }}
version: ${{ needs.generate-version.outputs.new_version }}
secrets: inherit

Copilot uses AI. Check for mistakes.
strategy:
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The strategy block is incompatible with reusable workflows. When using uses: at the job level, you cannot define a matrix strategy in the calling workflow. The matrix should be handled within the reusable workflow itself.

Copilot uses AI. Check for mistakes.
matrix:
project:
- name: Blake.Types
path: src/Blake.Types/Blake.Types.csproj
- name: Blake.MarkdownParser
path: src/Blake.MarkdownParser/Blake.MarkdownParser.csproj
- name: Blake.BuildTools
path: src/Blake.BuildTools/Blake.BuildTools.csproj
- name: Blake.CLI
path: src/Blake.CLI/Blake.CLI.csproj
36 changes: 15 additions & 21 deletions .github/workflows/reusable-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,23 @@ on:
description: 'Version to use for packaging'
type: string
required: true
nuget_key:
description: 'NuGet API key'
type: string
required: true

jobs:
package-and-publish-lib:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
runs-on: ubuntu-latest

- name: Generate NuGet package
run: |
dotnet pack ${{ inputs.project_path }} \
--configuration Release \
-p:PackageVersion=${{ inputs.version }} \
-o packages
steps:
- uses: actions/checkout@v4

- name: Publish NuGet package
run: dotnet nuget push packages/*.nupkg --api-key ${{ inputs.nuget_key }} --source https://api.nuget.org/v3/index.json
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Generate NuGet package
run: |
dotnet pack ${{ inputs.project_path }} \
--configuration Release \
-p:PackageVersion=${{ inputs.version }} \
-o packages
- name: Publish NuGet package
run: dotnet nuget push packages/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json