From 42d9354e411b4e4aa19aa708f105552b86766e64 Mon Sep 17 00:00:00 2001 From: bothzoli Date: Thu, 23 May 2024 11:23:11 +1000 Subject: [PATCH 1/2] Create strong named assembiles 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. --- ...harpFunctionalExtensions.StrongName.csproj | 63 ++++++++++++++++++ .../CSharpFunctionalExtensions.snk | Bin 0 -> 596 bytes CSharpFunctionalExtensions.sln | 6 ++ Dockerfile | 5 ++ azure-pipelines.yml | 21 +++++- version.txt | 6 +- 6 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.StrongName.csproj create mode 100644 CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.snk diff --git a/CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.StrongName.csproj b/CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.StrongName.csproj new file mode 100644 index 00000000..597c2b96 --- /dev/null +++ b/CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.StrongName.csproj @@ -0,0 +1,63 @@ + + + net40;net45;net461;netstandard2.0;net5.0;net6.0 + CSharpFunctionalExtensions.StrongName + Vladimir Khorikov + CSharpFunctionalExtensions - functional extensions for C# + false + C# Functional + MIT + https://enterprisecraftsmanship.com/ps-func + https://github.com/vkhorikov/CSharpFunctionalExtensions/ + en-US + false + 9.0 + false + true + true + true + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + 1591;1701;1702 + CSharpFunctionalExtensions.snk + true + + + + CSharpFunctionalExtensions (with a strong name) .NET 4.5 + + + CSharpFunctionalExtensions (with a strong name) .NET 4.6.1 + + + CSharpFunctionalExtensions (with a strong name) .NET Standard 2.0 + + + CSharpFunctionalExtensions (with a strong name) .NET 5.0 + + + CSharpFunctionalExtensions (with a strong name) .NET 6.0 + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + diff --git a/CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.snk b/CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.snk new file mode 100644 index 0000000000000000000000000000000000000000..431c9cf2f7c2c3d503739ba0c1a4c1459fce27d2 GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096cUJ9_=+_?s$+*(z^YUDB6uX1{O-+#gg zWoM^0TNYwGO+eIOM%T~;b+9u+c>&>7=J5CLuR)gW)HB`GzlK4v#EWXr{*=lDMG^+wY&OYQvVZgd|d^3w0h$fyJU$CV82&UX)fOPcGj-f@o;VPF3rIHet6 zAdFXM#-qX&ekZ-u>cT1};Nyb`y3W|$FE()D5!&?-ZCC6zzsT`oMu#}*R!>Tb0~}z# z!@-Gz2&{)kBoSXdW`x;^5jFq%Iz>dgJe%?t@2#FUr?DaD7r^c8xJn}8j<2r~OXHe6fu-v2jy~ngiP-f72>B%bJ$D%2JNyCYMh#@8mb|B zRW~{%P&-l43e{GYDTr@mFaR(}G;_-&12Prfiz@~qDq@JE;R(YcUQ`~K*fg7j^@o|R i>n`PlZC)@~hr_;EMhwEyZlPoVR;%~&7RWaE6epjPLm~ Date: Thu, 23 May 2024 20:39:13 +1000 Subject: [PATCH 2/2] Create Common.Build.props for property reuse --- ...harpFunctionalExtensions.StrongName.csproj | 95 ++++++++----------- CSharpFunctionalExtensions.sln | 1 + .../CSharpFunctionalExtensions.csproj | 39 +++----- Common.Build.props | 21 ++++ Dockerfile | 1 + azure-pipelines.yml | 3 +- 6 files changed, 77 insertions(+), 83 deletions(-) create mode 100644 Common.Build.props diff --git a/CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.StrongName.csproj b/CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.StrongName.csproj index 597c2b96..89d6ced9 100644 --- a/CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.StrongName.csproj +++ b/CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.StrongName.csproj @@ -1,63 +1,48 @@  - - net40;net45;net461;netstandard2.0;net5.0;net6.0 - CSharpFunctionalExtensions.StrongName - Vladimir Khorikov - CSharpFunctionalExtensions - functional extensions for C# - false - C# Functional - MIT - https://enterprisecraftsmanship.com/ps-func - https://github.com/vkhorikov/CSharpFunctionalExtensions/ - en-US - false - 9.0 - false - true - true - true - $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - 1591;1701;1702 - CSharpFunctionalExtensions.snk - true - + - - CSharpFunctionalExtensions (with a strong name) .NET 4.5 - - - CSharpFunctionalExtensions (with a strong name) .NET 4.6.1 - - - CSharpFunctionalExtensions (with a strong name) .NET Standard 2.0 - - - CSharpFunctionalExtensions (with a strong name) .NET 5.0 - - - CSharpFunctionalExtensions (with a strong name) .NET 6.0 - + + CSharpFunctionalExtensions.StrongName + CSharpFunctionalExtensions.snk + true + - - - + + CSharpFunctionalExtensions (with a strong name) .NET 4.5 + + + CSharpFunctionalExtensions (with a strong name) .NET 4.6.1 + + + CSharpFunctionalExtensions (with a strong name) .NET Standard 2.0 + + + CSharpFunctionalExtensions (with a strong name) .NET 5.0 + + + CSharpFunctionalExtensions (with a strong name) .NET 6.0 + - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + - - - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - - - + + + + + + + + + diff --git a/CSharpFunctionalExtensions.sln b/CSharpFunctionalExtensions.sln index 6d90e169..ef8c13b3 100644 --- a/CSharpFunctionalExtensions.sln +++ b/CSharpFunctionalExtensions.sln @@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Dockerfile = Dockerfile README.md = README.md version.txt = version.txt + Common.Build.props = Common.Build.props EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpFunctionalExtensions.StrongName", "CSharpFunctionalExtensions.StrongName\CSharpFunctionalExtensions.StrongName.csproj", "{A86176EF-DCC2-44E5-8F0F-D5F58006DEBB}" diff --git a/CSharpFunctionalExtensions/CSharpFunctionalExtensions.csproj b/CSharpFunctionalExtensions/CSharpFunctionalExtensions.csproj index 2545f550..173716db 100644 --- a/CSharpFunctionalExtensions/CSharpFunctionalExtensions.csproj +++ b/CSharpFunctionalExtensions/CSharpFunctionalExtensions.csproj @@ -1,23 +1,8 @@  + + - net40;net45;net461;netstandard2.0;net5.0;net6.0 CSharpFunctionalExtensions - Vladimir Khorikov - CSharpFunctionalExtensions - functional extensions for C# - false - C# Functional - MIT - https://enterprisecraftsmanship.com/ps-func - https://github.com/vkhorikov/CSharpFunctionalExtensions/ - en-US - false - 9.0 - false - true - true - true - $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - 1591;1701;1702 @@ -38,14 +23,14 @@ - <_Parameter1>CSharpFunctionalExtensions.Tests + <_Parameter1>CSharpFunctionalExtensions.Tests - + - + all @@ -54,9 +39,9 @@ - - - + + + BindIf.cs @@ -118,13 +103,13 @@ GetValueOrDefault.cs - Map.cs + Map.cs - AsMaybe.cs + AsMaybe.cs - AsMaybe.cs + AsMaybe.cs MapIf.cs @@ -664,7 +649,7 @@ MapTry.ValueTask.cs - GetValueOrDefault.cs + GetValueOrDefault.cs GetValueOrDefault.Task.cs diff --git a/Common.Build.props b/Common.Build.props new file mode 100644 index 00000000..fb3e81c0 --- /dev/null +++ b/Common.Build.props @@ -0,0 +1,21 @@ + + + net40;net45;net461;netstandard2.0;net5.0;net6.0 + Vladimir Khorikov + CSharpFunctionalExtensions - functional extensions for C# + false + C# Functional + MIT + https://enterprisecraftsmanship.com/ps-func + https://github.com/vkhorikov/CSharpFunctionalExtensions/ + en-US + false + 9.0 + false + true + true + true + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + 1591;1701;1702 + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index da6d3d4f..35f818f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0 as build ARG Version WORKDIR /app +COPY ./Common.Build.props ./ COPY ./CSharpFunctionalExtensions/CSharpFunctionalExtensions.csproj ./CSharpFunctionalExtensions/ COPY ./CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.StrongName.csproj ./CSharpFunctionalExtensions.StrongName/ COPY ./CSharpFunctionalExtensions.Tests/CSharpFunctionalExtensions.Tests.csproj ./CSharpFunctionalExtensions.Tests/ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 92f1efec..8c250557 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,6 +34,7 @@ stages: - job: BuildAndTest displayName: Build and test dependsOn: Version + condition: succeeded('Version') variables: newVersion: $[ dependencies.Version.outputs['readNewVersionStep.newVersion'] ] steps: @@ -77,7 +78,7 @@ stages: contentTypeHeader2: 'Content-Type: application/octet-stream' authHeader: 'Authorization: Bearer $(gitHubToken)' createReleaseRequest: '{ "tag_name": "v$(newVersion)", "target_commitish": "master", "name": "v$(newVersion)", "body": "$(releaseInfo)", "draft": false, "prerelease": false }' - condition: ne(dependencies.Version.outputs['readNewVersionStep.newVersion'], dependencies.Version.outputs['readCurrentVersionStep.currentVersion']) + condition: and(succeeded('Version'), succeeded('BuildAndTest'), ne(dependencies.Version.outputs['readNewVersionStep.newVersion'], dependencies.Version.outputs['readCurrentVersionStep.currentVersion'])) steps: - script: | echo $(newVersion)