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

Add strong name #288

Merged
merged 7 commits into from
Mar 11, 2025
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
3 changes: 3 additions & 0 deletions .github/workflows/build_and_run_unit_tests_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
- name: Add snk for strong name signing
run: |
echo "${{ secrets.KEY_SNK_B64 }}" | base64 --decode > key.snk
- name: Add zip files required for running tests
run: |
(cd resources/geocoding; zip -r ../../resources/geocoding.zip *)
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/run_all_tests_and_upload_code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
- name: Add key.snk for strong name signing
run: |
echo "${{ secrets.KEY_SNK_B64 }}" | Out-File key.snk.b64
certutil -decode key.snk.b64 key.snk
- name: Add zip files required for running tests
run: |
Compress-Archive -Path "resources\geocoding\*" -DestinationPath "resources\geocoding.zip"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/run_performance_tests_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Add key.snk for strong name signing
run: |
echo "${{ secrets.KEY_SNK_B64 }}" | Out-File key.snk.b64
certutil -decode key.snk.b64 key.snk
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ configuration: Release
environment:
COV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ZMWUFNNe5xveY6+SGB6NGU+wYWwqA9eyBmv9YEQl7NNWMVHJtBzp2Q9S/BlShEcv+nB3TqWbPuZE0j6K7qhyVdOw4+HMYZOI=
pull_requests:
do_not_increment_build_number: true
branches:
only:
- main
before_build:
- ps: $env:KEY_SNK_B64 | Set-Content -Path "key.snk.b64"
- certutil -decode key.snk.b64 key.snk
- dotnet restore csharp -s https://api.nuget.org/v3/index.json
- ps: Compress-Archive -Path "resources\geocoding\*" -DestinationPath "resources\geocoding.zip"
- ps: Compress-Archive -Path "resources\test\geocoding\*" -DestinationPath "resources\test\testgeocoding.zip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(APPVEYOR_PULL_REQUEST_NUMBER)' == ''">
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../../key.snk</AssemblyOriginatorKeyFile>
<PublicSign>true</PublicSign>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net9.0'">
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions csharp/PhoneNumbers.Extensions/PhoneNumbers.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
<AnalysisLevel>5</AnalysisLevel>
</PropertyGroup>

<PropertyGroup Condition="'$(APPVEYOR_PULL_REQUEST_NUMBER)' == ''">
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../../key.snk</AssemblyOriginatorKeyFile>
<PublicSign>true</PublicSign>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions csharp/PhoneNumbers.Test/PhoneNumbers.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(APPVEYOR_PULL_REQUEST_NUMBER)' == ''">
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../../key.snk</AssemblyOriginatorKeyFile>
<PublicSign>true</PublicSign>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net9.0'">
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
7 changes: 7 additions & 0 deletions csharp/PhoneNumbers/PhoneNumbers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup Condition="'$(APPVEYOR_PULL_REQUEST_NUMBER)' == ''">
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../../key.snk</AssemblyOriginatorKeyFile>
<PublicSign>true</PublicSign>
<DefineConstants>$(DefineConstants);SIGNED</DefineConstants>
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Include="..\..\resources\*.xml" Exclude="..\..\resources\PhoneNumberMetadataForTesting.xml" />
<EmbeddedResource Include="..\..\resources\timezones\map_data.txt" LinkBase="timezones" />
Expand Down
4 changes: 4 additions & 0 deletions csharp/PhoneNumbers/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
using System.Collections.Generic;
using System.Runtime.CompilerServices;

#if !SIGNED
[assembly: InternalsVisibleTo("PhoneNumbers.Test")]
#else
[assembly: InternalsVisibleTo("PhoneNumbers.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100bd3070027f51a9975cac34376755e3629985626c0ccbb41bb057f7d06dd6940dafb35ed0358fd96f24525cde3229cecc6fc9eb3bf582ecb6cf3a837f422d38fe2f5d2d7d0b75a5fe9120c77d3a0d25b9b60060cd715146920d675b6f639bcf9845bcf0f42070caca24be55143958dcc4eaa7e4e2941ecf2fab4ba479aaee8dc2")]
#endif

namespace PhoneNumbers
{
Expand Down