Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub workflow #26

Merged
merged 1 commit into from
Jan 20, 2024
Merged

Conversation

FantasyTeddy
Copy link
Contributor

Split the existing GitHub workflow into two distinct workflows:

  • Build and Test:
    • Also executes dotnet test to ensure that no unit tests are broken.
    • Does not publish the NuGet packages anymore. (This also prevents the situation where a PR run will always fail, because an outside contributor does not have the NUGET_API_KEY secret set.)
  • Publish NuGet package
    • Only executes on the main branch.

To consider:

  • The "Publish NuGet package" workflow should probably have a different trigger than pushing on main, because this does not ensure that a new package version has been set.
    (The --skip-duplicate option on dotnet nuget push also indicates that this can lead to unexpected behavior; e.g. packages not actually being published with the intended version.)
  • The dotnet build command in the "Publish NuGet package" workflow could be replaced by dotnet pack if the property GeneratePackageOnBuild is not set to true in the project files.

Copy link
Member

@cdavernas cdavernas left a comment

Choose a reason for hiding this comment

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

LGTM! Many thanks man!

For the trigger, I guess 'on tag' is indeed better than push. I'll make sure to add https://github.com/cbcrouse/Versioning.NET, which autoversions projects using commit messages.
The skip-duplicate option is an artefact from an old project I copy pasted the workflow from.

@cdavernas cdavernas merged commit 3ee0d78 into neuroglia-io:main Jan 20, 2024
1 check passed
@FantasyTeddy
Copy link
Contributor Author

Oh neat, I didn't know about the package you mentioned.

Glad I could help!

@FantasyTeddy FantasyTeddy deleted the github-ci branch January 20, 2024 14:55
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.

2 participants