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

Create strong named assembiles #543

Merged

Conversation

bothzoli
Copy link
Contributor

@bothzoli bothzoli commented May 23, 2024

Create strong named NuGet package

To create a strong named NuGet package, a new project CSharpFunctionalExtensions.StrongName was added to the solution.
The project references source files from CSharpFunctionalExtensions.csproj and it uses the generated signing key (CSharpFunctionalExtensions.snk) to sign the assembly.

The Dockerfile was updated so that a strong named NuGet package is also built.
The azure-pipelines.yml was also modified so that the newly created package is uploaded as both a GitHub release asset and to nuget.org as well.

Minor fixes were applied to the azure-pipelines.yml file:

  • the authorization header should have Bearer instead of token based on the documentation
  • the cURL upload should use the --data-binary switch (note that nuget packages were not added to previous releases either)
  • run conditions were added to the publish steps so that the pipeline won't fail if the credentials are not provided, but simply skip the publish steps

The version file version.txt was also updated with a patch version bump.

Fixes: #27

@bothzoli bothzoli closed this May 23, 2024
@bothzoli bothzoli reopened this May 23, 2024
@bothzoli bothzoli force-pushed the create-strong-named-nuget-package branch 2 times, most recently from 5b7b8ad to 2c9e93e Compare May 23, 2024 02:35
@bothzoli bothzoli mentioned this pull request May 23, 2024
@bothzoli bothzoli force-pushed the create-strong-named-nuget-package branch from 2c9e93e to 5d1d850 Compare May 23, 2024 02:43
New project was added to create strong named assembiles.
Signing key is included inside the project.
The Dockerfile was updated to build the strong named assembly package.
Azure pipelines were updated to publish nuget package as a GitHub asset
and also to NuGet.org.
@bothzoli bothzoli force-pushed the create-strong-named-nuget-package branch from 5d1d850 to 42d9354 Compare May 23, 2024 02:54
@hankovich
Copy link
Collaborator

New csproj is just a copy of the existing one. I suggest you to move common properties to Directory.Build.props

@bothzoli
Copy link
Contributor Author

Oh yeah, thanks mate. I knew something was amiss.
I'll update the PR shortly.

@bothzoli
Copy link
Contributor Author

I wonder though, wouldn't a Directory.Build.props be imported into all projects including Examples, Tests?
I'm not sure that'd be correct.
Shall I separate the main projects into an src folder?
Or use a different .props file and explicitly import where needed?

@bothzoli bothzoli force-pushed the create-strong-named-nuget-package branch from 1ee91e0 to 699d24f Compare May 23, 2024 10:51
@bothzoli bothzoli force-pushed the create-strong-named-nuget-package branch from 699d24f to 71f669c Compare May 23, 2024 10:57
@bothzoli
Copy link
Contributor Author

I've gone with a Common.Build.props file at the root of the solution.
Please let me know if you'd prefer a different approach.

@bothzoli
Copy link
Contributor Author

Hey, any thoughts on the PR?
Thanks

@vkhorikov
Copy link
Owner

Hey, sorry, really short on time these days. I'll test it during the upcoming weekend and will push it "to prod" if everything looks good (which it does on the first glance).

@vkhorikov vkhorikov merged commit 4414c0e into vkhorikov:master Jun 23, 2024
1 check passed
@vkhorikov
Copy link
Owner

The current approach looks good, no need to include the common proj into examples and tests, those aren't getting published anyway. Locally everything looks good, merged it to master, let's see how the build goes.

@vkhorikov
Copy link
Owner

vkhorikov commented Jun 23, 2024

note that nuget packages were not added to previous releases either

Yeah, binaries stopped being published to GitHub awhile ago, this is the last release where it did get published: https://github.com/vkhorikov/CSharpFunctionalExtensions/releases/tag/v2.14.0

The new --data-binary option didn't help, I think it's something with the URL that GitHub has changed because the last 2 commands return 404.

@vkhorikov
Copy link
Owner

The pipeline has published the new nuget package successfully.

@bothzoli
Copy link
Contributor Author

Wow, that's awesome news. I'll start using it right away.
Thank you very much 😊
I'll try to keep my eyes open, but if there are issues opened for the strong named package (that are working correctly with the regular one) feel free to tag me in the issue.

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.

Strong Name
3 participants