Skip to content

Commit ad36023

Browse files
authored
feat: strong names for published assemblies (#586)
1 parent 5d52a2a commit ad36023

File tree

21 files changed

+196
-97
lines changed

21 files changed

+196
-97
lines changed

.github/workflows/publish.yml

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ permissions:
1313
contents: read
1414

1515
jobs:
16-
build:
17-
runs-on: ubuntu-latest
16+
publish:
17+
runs-on: windows-latest
1818
steps:
1919
- uses: actions/checkout@v4
2020

@@ -26,32 +26,50 @@ jobs:
2626
6.0.x
2727
2828
- name: 'Restore packages'
29+
shell: pwsh
2930
run: |
3031
dotnet restore ${{ env.SOLUTION_PATH }}
3132
32-
# Use AspectInjector 2.8.2 which, unlike 2.8.1, correctly sets PdbChecksum
33-
# The only reason we're still referencing 2.8.1 from projects is that
34-
# 2.8.2 doesn't work well on Mac OS ARM
33+
- name: 'Resolve sn.exe location'
34+
id: find-snexe
35+
shell: pwsh
36+
run: |
37+
$SnExeLocation = ./build/findvstool.ps1 -ToolName 'sn.exe'
38+
Write-Host "Found '$SnExeLocation'"
39+
"path=$SnExeLocation" >> $Env:GITHUB_OUTPUT
40+
3541
- name: 'Build project using dotnet'
42+
shell: pwsh
43+
run: |
44+
dotnet build ${{ env.SOLUTION_PATH }} `
45+
--no-restore `
46+
--configuration ${{ env.BUILD_CONFIGURATION }} `
47+
-p:ContinuousIntegrationBuild=true `
48+
"-p:Allure_SnExePath=${{ steps.find-snexe.outputs.path }}"
49+
50+
- name: Verify assembly strong names
51+
shell: pwsh
3652
run: |
37-
dotnet build ${{ env.SOLUTION_PATH }}\
38-
--no-restore\
39-
--configuration ${{ env.BUILD_CONFIGURATION }}\
40-
-p:ContinuousIntegrationBuild=true\
41-
"-p:AspectInjector_Location=${{ github.workspace }}/build/AspectInjector/linux-x64/AspectInjector"
53+
$SnExe = "${{ steps.find-snexe.outputs.path }}"
54+
Get-ChildItem "./*/bin/*/*/Allure.*.dll" -Exclude "Allure.SpecFlow*","Allure.Xunit*" | ForEach-Object {
55+
& $SnExe -vf $_.FullName
56+
}
4257
4358
- name: 'Pack project'
59+
shell: pwsh
4460
run: |
45-
dotnet pack ${{ env.SOLUTION_PATH }}\
46-
--no-restore\
47-
--no-build\
48-
--configuration ${{ env.BUILD_CONFIGURATION }}\
61+
dotnet pack ${{ env.SOLUTION_PATH }} `
62+
--no-restore `
63+
--no-build `
64+
--configuration ${{ env.BUILD_CONFIGURATION }} `
65+
"-p:PackageReleaseNotes=${{ github.event.release.html_url }}" `
4966
"-p:PackageOutputPath=${{ github.workspace }}/${{ env.PACKAGE_OUTPUT_PATH }}"
5067
5168
- name: 'NuGet publish'
69+
shell: pwsh
5270
run: |
53-
dotnet nuget push "${{ env.PACKAGE_OUTPUT_PATH }}/*.nupkg"\
54-
-k ${NUGET_TOKEN}\
71+
dotnet nuget push "${{ env.PACKAGE_OUTPUT_PATH }}/*.nupkg" `
72+
-k ${NUGET_TOKEN} `
5573
-s https://api.nuget.org/v3/index.json
5674
env:
5775
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}

.github/workflows/release.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ jobs:
7878
cat ./Allure.Reqnroll/allureConfig.Template.json
7979
sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Reqnroll.Tests.Samples/allureConfig.json
8080
cat ./Allure.Reqnroll.Tests.Samples/allureConfig.json
81-
- name: "Update release notes link"
82-
run: |
83-
sed -i -e '/<PackageReleaseNotes>/,/<\/PackageReleaseNotes>/ s|/tag/[0-9a-zA-Z.|-]*|/tag/${{ env.release_version }}|g' ./Directory.Build.props
84-
cat ./Directory.Build.props
8581
- name: "Commit release version and create tag"
8682
run: |
8783
git commit -am "release ${{ env.release_version }}"
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
name: Build
1+
name: Test
22

33
env:
44
SOLUTION_PATH: allure-csharp.sln
55
BUILD_CONFIGURATION: 'Release'
6-
PACKAGE_OUTPUT_PATH: 'artifacts'
76

87
on:
98
workflow_dispatch:
@@ -19,8 +18,7 @@ permissions:
1918
contents: read
2019

2120
jobs:
22-
build:
23-
name: "Build"
21+
test:
2422
runs-on: ubuntu-latest
2523
steps:
2624
- uses: actions/checkout@v4

Allure.NUnit/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,3 @@ The following previously deprecated user API classes and methods were removed:
8989
instead.
9090
- `Allure.Net.Commons.Steps.CoreStepsHelper` - use functions from
9191
`Allure.Net.Commons.AllureApi` and `Allure.Net.Commons.ExtendedApi` instead.
92-
93-
### For users of Mac with Apple silicon
94-
95-
If you're developing on a Mac machine with Apple silicon, make sure you have
96-
Rosetta installed. Follow this article for the instructions:
97-
https://support.apple.com/en-us/HT211861
98-
99-
You may also install Rosetta via the CLI:
100-
101-
```shell
102-
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
103-
```

Allure.Net.Commons/Allure.Net.Commons.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<None Include="README.md" Pack="true" PackagePath="\" />
1515
<None Include="./../img/Allure-Color.png" Pack="true" PackagePath="\" />
1616
<Content Include="allureConfig.Template.json" Pack="true" />
17-
<PackageReference Include="AspectInjector" Version="2.8.1" />
17+
<PackageReference Include="AspectInjector" Version="2.9.0" />
1818
<PackageReference Include="MimeTypesMap" Version="1.0.8" />
1919
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2020
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
using System.Runtime.CompilerServices;
22

3-
[assembly: InternalsVisibleTo("Allure.Net.Commons.Tests")]
4-
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
3+
[assembly: InternalsVisibleTo(
4+
"Allure.Net.Commons.Tests, PublicKey=" +
5+
"00240000048000009400000006020000" +
6+
"00240000525341310004000001000100" +
7+
"A5B2C91A39AB4B9F331EB97857938818" +
8+
"181EFDE08132B2A00F27A007F8402C3C" +
9+
"BAB29A13DAF3D22693D0A4BAF191D7AA" +
10+
"BF32004ACA499E65532AE484D37DAD74" +
11+
"822D45DBA8ED5365C03B34F372E6C534" +
12+
"F609EAD50A3491497F0E5A3A7263986A" +
13+
"5E670B69857D6BA01D61C43749132080" +
14+
"BF8091D435E75F528E2A2C35EC34CBA0"
15+
)]
16+
[assembly: InternalsVisibleTo(
17+
"DynamicProxyGenAssembly2, PublicKey=" +
18+
"00240000048000009400000006020000" +
19+
"00240000525341310004000001000100" +
20+
"C547CAC37ABD99C8DB225EF2F6C8A360" +
21+
"2F3B3606CC9891605D02BAA56104F4CF" +
22+
"C0734AA39B93BF7852F7D9266654753C" +
23+
"C297E7D2EDFE0BAC1CDCF9F717241550" +
24+
"E0A7B191195B7667BB4F64BCB8E21213" +
25+
"80FD1D9D46AD2D92D2D15605093924CC" +
26+
"EAF74C4861EFF62ABF69B9291ED0A340" +
27+
"E113BE11E6A7D3113E92484CF7045CC7"
28+
)]

Allure.Net.Commons/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@ The library can be used by any project that targets a framework compatible with
2121
.NET Standard 2.0 (.NET Framework 4.6.1+, .NET Core 2.0+, .NET 5.0+, and more).
2222
See the complete list [here](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0#select-net-standard-version).
2323

24-
## Note for users of Mac with Apple silicon
25-
26-
If you're developing on a Mac machine with Apple silicon, make sure you have
27-
Rosetta installed. Follow this article for the instructions:
28-
https://support.apple.com/en-us/HT211861
29-
30-
You may also install Rosetta via the CLI:
31-
32-
```shell
33-
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
34-
```
35-
3624
## Configuration
3725

3826
The Allure lifecycle is configured via a JSON file with the default name
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
using System.Runtime.CompilerServices;
22

3-
[assembly: InternalsVisibleTo("Allure.Reqnroll.Tests")]
3+
[assembly: InternalsVisibleTo(
4+
"Allure.Reqnroll.Tests, PublicKey=" +
5+
"00240000048000009400000006020000" +
6+
"00240000525341310004000001000100" +
7+
"A5B2C91A39AB4B9F331EB97857938818" +
8+
"181EFDE08132B2A00F27A007F8402C3C" +
9+
"BAB29A13DAF3D22693D0A4BAF191D7AA" +
10+
"BF32004ACA499E65532AE484D37DAD74" +
11+
"822D45DBA8ED5365C03B34F372E6C534" +
12+
"F609EAD50A3491497F0E5A3A7263986A" +
13+
"5E670B69857D6BA01D61C43749132080" +
14+
"BF8091D435E75F528E2A2C35EC34CBA0"
15+
)]

Allure.SpecFlow.Tests.Samples/Allure.SpecFlow.Tests.Samples.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net8.0</TargetFramework>
4+
<SignAssembly>false</SignAssembly>
45
</PropertyGroup>
56

67
<ItemGroup>

Allure.SpecFlow.Tests/Allure.SpecFlow.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
5+
<SignAssembly>false</SignAssembly>
56
</PropertyGroup>
67

78
<ItemGroup>

0 commit comments

Comments
 (0)