diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b3ec908a..239a41ad 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,8 +13,8 @@ permissions: contents: read jobs: - build: - runs-on: ubuntu-latest + publish: + runs-on: windows-latest steps: - uses: actions/checkout@v4 @@ -26,32 +26,50 @@ jobs: 6.0.x - name: 'Restore packages' + shell: pwsh run: | dotnet restore ${{ env.SOLUTION_PATH }} - # Use AspectInjector 2.8.2 which, unlike 2.8.1, correctly sets PdbChecksum - # The only reason we're still referencing 2.8.1 from projects is that - # 2.8.2 doesn't work well on Mac OS ARM + - name: 'Resolve sn.exe location' + id: find-snexe + shell: pwsh + run: | + $SnExeLocation = ./build/findvstool.ps1 -ToolName 'sn.exe' + Write-Host "Found '$SnExeLocation'" + "path=$SnExeLocation" >> $Env:GITHUB_OUTPUT + - name: 'Build project using dotnet' + shell: pwsh + run: | + dotnet build ${{ env.SOLUTION_PATH }} ` + --no-restore ` + --configuration ${{ env.BUILD_CONFIGURATION }} ` + -p:ContinuousIntegrationBuild=true ` + "-p:Allure_SnExePath=${{ steps.find-snexe.outputs.path }}" + + - name: Verify assembly strong names + shell: pwsh run: | - dotnet build ${{ env.SOLUTION_PATH }}\ - --no-restore\ - --configuration ${{ env.BUILD_CONFIGURATION }}\ - -p:ContinuousIntegrationBuild=true\ - "-p:AspectInjector_Location=${{ github.workspace }}/build/AspectInjector/linux-x64/AspectInjector" + $SnExe = "${{ steps.find-snexe.outputs.path }}" + Get-ChildItem "./*/bin/*/*/Allure.*.dll" -Exclude "Allure.SpecFlow*","Allure.Xunit*" | ForEach-Object { + & $SnExe -vf $_.FullName + } - name: 'Pack project' + shell: pwsh run: | - dotnet pack ${{ env.SOLUTION_PATH }}\ - --no-restore\ - --no-build\ - --configuration ${{ env.BUILD_CONFIGURATION }}\ + dotnet pack ${{ env.SOLUTION_PATH }} ` + --no-restore ` + --no-build ` + --configuration ${{ env.BUILD_CONFIGURATION }} ` + "-p:PackageReleaseNotes=${{ github.event.release.html_url }}" ` "-p:PackageOutputPath=${{ github.workspace }}/${{ env.PACKAGE_OUTPUT_PATH }}" - name: 'NuGet publish' + shell: pwsh run: | - dotnet nuget push "${{ env.PACKAGE_OUTPUT_PATH }}/*.nupkg"\ - -k ${NUGET_TOKEN}\ + dotnet nuget push "${{ env.PACKAGE_OUTPUT_PATH }}/*.nupkg" ` + -k ${NUGET_TOKEN} ` -s https://api.nuget.org/v3/index.json env: NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 295f6e56..27af5243 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,10 +78,6 @@ jobs: cat ./Allure.Reqnroll/allureConfig.Template.json sed -i -e '/"$schema"/s|/allure-csharp/[^/]*|/allure-csharp/${{ env.release_version }}|g' ./Allure.Reqnroll.Tests.Samples/allureConfig.json cat ./Allure.Reqnroll.Tests.Samples/allureConfig.json - - name: "Update release notes link" - run: | - sed -i -e '//,/<\/PackageReleaseNotes>/ s|/tag/[0-9a-zA-Z.|-]*|/tag/${{ env.release_version }}|g' ./Directory.Build.props - cat ./Directory.Build.props - name: "Commit release version and create tag" run: | git commit -am "release ${{ env.release_version }}" diff --git a/.github/workflows/build.yml b/.github/workflows/test.yml similarity index 94% rename from .github/workflows/build.yml rename to .github/workflows/test.yml index 4b04cc69..538f73f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,8 @@ -name: Build +name: Test env: SOLUTION_PATH: allure-csharp.sln BUILD_CONFIGURATION: 'Release' - PACKAGE_OUTPUT_PATH: 'artifacts' on: workflow_dispatch: @@ -19,8 +18,7 @@ permissions: contents: read jobs: - build: - name: "Build" + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/Allure.NUnit/README.md b/Allure.NUnit/README.md index e08f92df..74adcecd 100644 --- a/Allure.NUnit/README.md +++ b/Allure.NUnit/README.md @@ -89,15 +89,3 @@ The following previously deprecated user API classes and methods were removed: instead. - `Allure.Net.Commons.Steps.CoreStepsHelper` - use functions from `Allure.Net.Commons.AllureApi` and `Allure.Net.Commons.ExtendedApi` instead. - -### For users of Mac with Apple silicon - -If you're developing on a Mac machine with Apple silicon, make sure you have -Rosetta installed. Follow this article for the instructions: -https://support.apple.com/en-us/HT211861 - -You may also install Rosetta via the CLI: - -```shell -/usr/sbin/softwareupdate --install-rosetta --agree-to-license -``` diff --git a/Allure.Net.Commons/Allure.Net.Commons.csproj b/Allure.Net.Commons/Allure.Net.Commons.csproj index 10fb17d0..31a23735 100644 --- a/Allure.Net.Commons/Allure.Net.Commons.csproj +++ b/Allure.Net.Commons/Allure.Net.Commons.csproj @@ -14,7 +14,7 @@ - + diff --git a/Allure.Net.Commons/Internal/AssemblyAttributes.cs b/Allure.Net.Commons/Internal/AssemblyAttributes.cs index 90a34646..34c4ecee 100644 --- a/Allure.Net.Commons/Internal/AssemblyAttributes.cs +++ b/Allure.Net.Commons/Internal/AssemblyAttributes.cs @@ -1,4 +1,28 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("Allure.Net.Commons.Tests")] -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] +[assembly: InternalsVisibleTo( + "Allure.Net.Commons.Tests, PublicKey=" + + "00240000048000009400000006020000" + + "00240000525341310004000001000100" + + "A5B2C91A39AB4B9F331EB97857938818" + + "181EFDE08132B2A00F27A007F8402C3C" + + "BAB29A13DAF3D22693D0A4BAF191D7AA" + + "BF32004ACA499E65532AE484D37DAD74" + + "822D45DBA8ED5365C03B34F372E6C534" + + "F609EAD50A3491497F0E5A3A7263986A" + + "5E670B69857D6BA01D61C43749132080" + + "BF8091D435E75F528E2A2C35EC34CBA0" +)] +[assembly: InternalsVisibleTo( + "DynamicProxyGenAssembly2, PublicKey=" + + "00240000048000009400000006020000" + + "00240000525341310004000001000100" + + "C547CAC37ABD99C8DB225EF2F6C8A360" + + "2F3B3606CC9891605D02BAA56104F4CF" + + "C0734AA39B93BF7852F7D9266654753C" + + "C297E7D2EDFE0BAC1CDCF9F717241550" + + "E0A7B191195B7667BB4F64BCB8E21213" + + "80FD1D9D46AD2D92D2D15605093924CC" + + "EAF74C4861EFF62ABF69B9291ED0A340" + + "E113BE11E6A7D3113E92484CF7045CC7" +)] diff --git a/Allure.Net.Commons/README.md b/Allure.Net.Commons/README.md index ba14ae67..5e5e7366 100644 --- a/Allure.Net.Commons/README.md +++ b/Allure.Net.Commons/README.md @@ -21,18 +21,6 @@ The library can be used by any project that targets a framework compatible with .NET Standard 2.0 (.NET Framework 4.6.1+, .NET Core 2.0+, .NET 5.0+, and more). See the complete list [here](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0#select-net-standard-version). -## Note for users of Mac with Apple silicon - -If you're developing on a Mac machine with Apple silicon, make sure you have -Rosetta installed. Follow this article for the instructions: -https://support.apple.com/en-us/HT211861 - -You may also install Rosetta via the CLI: - -```shell -/usr/sbin/softwareupdate --install-rosetta --agree-to-license -``` - ## Configuration The Allure lifecycle is configured via a JSON file with the default name diff --git a/Allure.Reqnroll/Internal/AssemblyAttributes.cs b/Allure.Reqnroll/Internal/AssemblyAttributes.cs index 899fb070..e0b58a39 100644 --- a/Allure.Reqnroll/Internal/AssemblyAttributes.cs +++ b/Allure.Reqnroll/Internal/AssemblyAttributes.cs @@ -1,3 +1,15 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("Allure.Reqnroll.Tests")] \ No newline at end of file +[assembly: InternalsVisibleTo( + "Allure.Reqnroll.Tests, PublicKey=" + + "00240000048000009400000006020000" + + "00240000525341310004000001000100" + + "A5B2C91A39AB4B9F331EB97857938818" + + "181EFDE08132B2A00F27A007F8402C3C" + + "BAB29A13DAF3D22693D0A4BAF191D7AA" + + "BF32004ACA499E65532AE484D37DAD74" + + "822D45DBA8ED5365C03B34F372E6C534" + + "F609EAD50A3491497F0E5A3A7263986A" + + "5E670B69857D6BA01D61C43749132080" + + "BF8091D435E75F528E2A2C35EC34CBA0" +)] \ No newline at end of file diff --git a/Allure.SpecFlow.Tests.Samples/Allure.SpecFlow.Tests.Samples.csproj b/Allure.SpecFlow.Tests.Samples/Allure.SpecFlow.Tests.Samples.csproj index 0624e99a..aacac1bf 100644 --- a/Allure.SpecFlow.Tests.Samples/Allure.SpecFlow.Tests.Samples.csproj +++ b/Allure.SpecFlow.Tests.Samples/Allure.SpecFlow.Tests.Samples.csproj @@ -1,6 +1,7 @@  net8.0 + false diff --git a/Allure.SpecFlow.Tests/Allure.SpecFlow.Tests.csproj b/Allure.SpecFlow.Tests/Allure.SpecFlow.Tests.csproj index 4f0e4118..75afa64f 100644 --- a/Allure.SpecFlow.Tests/Allure.SpecFlow.Tests.csproj +++ b/Allure.SpecFlow.Tests/Allure.SpecFlow.Tests.csproj @@ -2,6 +2,7 @@ net8.0 + false diff --git a/Allure.SpecFlow/Allure.SpecFlow.csproj b/Allure.SpecFlow/Allure.SpecFlow.csproj index dd115e9e..3a653b2e 100644 --- a/Allure.SpecFlow/Allure.SpecFlow.csproj +++ b/Allure.SpecFlow/Allure.SpecFlow.csproj @@ -11,6 +11,7 @@ Create beautiful reports from your SpecFlow tests. Allure-SF-Color.png $(PackageTags) specflow + false diff --git a/Allure.SpecFlow/README.md b/Allure.SpecFlow/README.md index 2aaf0137..5fb4c04f 100644 --- a/Allure.SpecFlow/README.md +++ b/Allure.SpecFlow/README.md @@ -24,26 +24,16 @@ The adapter works with [SpecFlow](http://specflow.org/) version 3, starting from 1. Install the [Allure.SpecFlow](https://www.nuget.org/packages/Allure.SpecFlow) Nuget package according to your SpecFlow version. 2. Add the following entry to your `specflow.json`: - ```json - { - "stepAssemblies": [ - {"assembly": "Allure.SpecFlowPlugin"} - ] - } - ``` -3. Run the tests. - -#### For users of Mac with Apple silicon -If you're developing on a Mac machine with Apple silicon, make sure you have -Rosetta installed. Follow this article for the instructions: -https://support.apple.com/en-us/HT211861 + ```json + { + "stepAssemblies": [ + { "assembly": "Allure.SpecFlowPlugin" } + ] + } + ``` -You may also install Rosetta via the CLI: - -```shell -/usr/sbin/softwareupdate --install-rosetta --agree-to-license -``` +3. Run the tests. ### Further readings diff --git a/Allure.Xunit.Examples/Allure.Xunit.Examples.csproj b/Allure.Xunit.Examples/Allure.Xunit.Examples.csproj index 929bff22..53125ac9 100644 --- a/Allure.Xunit.Examples/Allure.Xunit.Examples.csproj +++ b/Allure.Xunit.Examples/Allure.Xunit.Examples.csproj @@ -2,6 +2,7 @@ net8.0 + false diff --git a/Allure.Xunit/Allure.Xunit.csproj b/Allure.Xunit/Allure.Xunit.csproj index 9ef20321..7030e6a1 100644 --- a/Allure.Xunit/Allure.Xunit.csproj +++ b/Allure.Xunit/Allure.Xunit.csproj @@ -10,6 +10,7 @@ Create beautiful reports from your xUnit.net tests. Allure-X-Color.png $(PackageTags) xunit + false diff --git a/Allure.Xunit/README.md b/Allure.Xunit/README.md index ba70f669..9d68be6f 100644 --- a/Allure.Xunit/README.md +++ b/Allure.Xunit/README.md @@ -88,18 +88,6 @@ You should uninstall it and use attributes from the ## Known issues and limitations -### Rosetta is required for users on Mac with Apple silicon - -If you're developing on a Mac machine with Apple silicon, make sure you have -Rosetta installed. Follow this article for the instructions: -https://support.apple.com/en-us/HT211861 - -You may also install Rosetta via the CLI: - -```shell -/usr/sbin/softwareupdate --install-rosetta --agree-to-license -``` - ### MonoMod.Core issues We rely on Harmony (which in turn uses MonoMod.Core) to: diff --git a/Directory.Build.props b/Directory.Build.props index dbf242f6..279e6e0b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -18,13 +18,12 @@ README.md LICENSE allure - https://github.com/allure-framework/allure-csharp/releases/tag/2.12.1 - false - $(MSBuildThisFileDirectory)key.snk + true + $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), 'build', 'identity.snk')) diff --git a/Directory.Build.targets b/Directory.Build.targets index ca980677..47aa71a4 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,11 +1,11 @@ - $(MSBuildThisFileDirectory)build\TransformReadmeForNuget.cs + $(MSBuildThisFileDirectory)build\TransformReadmeForNuget.cs - + - @@ -21,7 +21,7 @@ + Source="$(Allure_TransformReadmeSource)"/> @@ -29,23 +29,64 @@ NuGet don't support (in particular, align, width and height). This task generates a new README file with those unsupported constructs removed. --> - - - - + PropertyName="Allure_NugetTransformedReadmePath" /> + + <_PackageFiles Remove="README.md" /> - <_PackageFiles Include="$(NugetTransformedReadmePath)"> + <_PackageFiles Include="$(Allure_NugetTransformedReadmePath)"> None /README.md + + + + + + %(IntermediateAssembly.ModifiedTime) + + + + + + %(IntermediateAssembly.ModifiedTime) + + + + + + + \ No newline at end of file diff --git a/build/AspectInjector/linux-x64/AspectInjector b/build/AspectInjector/linux-x64/AspectInjector deleted file mode 100755 index f93bffa4..00000000 Binary files a/build/AspectInjector/linux-x64/AspectInjector and /dev/null differ diff --git a/build/TransformReadmeForNuget.cs b/build/TransformReadmeForNuget.cs index 556be937..46464c7f 100644 --- a/build/TransformReadmeForNuget.cs +++ b/build/TransformReadmeForNuget.cs @@ -1,6 +1,6 @@ /* - * The source code of the TransformReadmeForNuget task defined in Directory.Build.targets. - * The task is used by the GenerateNugetReadmeFiles target. See Directory.Build.targets + * The source code of the Allure_TransformReadmeForNuget task defined in Directory.Build.targets. + * The task is used by the Allure_GenerateNugetReadmeFiles target. See Directory.Build.targets * for some details. * */ diff --git a/build/findvstool.ps1 b/build/findvstool.ps1 new file mode 100644 index 00000000..0ea9fb47 --- /dev/null +++ b/build/findvstool.ps1 @@ -0,0 +1,52 @@ +[CmdletBinding()] +Param +( + [Parameter(Mandatory = $True)] + [string] $ToolName +) + +$DEFAULT_VSWHERE_PATH = "${Env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + +If (-not $IsWindows) +{ + Throw "Can't run this script on $($PSVersionTable.Platform). Windows is required" +} + +$VsWhere = ("vswhere.exe", $DEFAULT_VSWHERE_PATH) | ForEach-Object { + Get-Command -CommandType Application -ErrorAction SilentlyContinue $_ +} | Select-Object -first 1 + +If (-not $VsWhere) +{ + Throw "vswhere.exe needs to be in PATH or at '$DEFAULT_VSWHERE_PATH'" +} + +$VsInstallPath = & $VsWhere -latest -property installationPath +If (-not $VsInstallPath) +{ + Throw "Can't get a Visual Studio installation path. vswhere.exe exited with code $LASTEXITCODE" +} +ElseIf (-not (Test-Path -PathType Container $VsInstallPath)) +{ + Throw "vswhere.exe has returned '$VsInstallPath' as the Visual Studio installation path, which doesn't exist" +} + +$LaunchDevToolPath = Join-Path $VsInstallPath 'Common7\Tools\Launch-VsDevShell.ps1' +if (-not (Test-Path -PathType Leaf $LaunchDevToolPath)) +{ + Throw "Can't find the Developer PowerShell launch script at '$LaunchDevToolPath'" +} + +$Cwd = Get-Location + +& $LaunchDevToolPath | Out-Null + +Set-Location $Cwd + +$Tool = Get-Command -CommandType Application -ErrorAction SilentlyContinue $ToolName +If (-not $Tool) +{ + Throw "Can't find $ToolName" +} + +$Tool.Source diff --git a/build/identity.snk b/build/identity.snk new file mode 100644 index 00000000..e358a354 Binary files /dev/null and b/build/identity.snk differ