Skip to content

Commit fdbbbe6

Browse files
committed
WIP #248 - Improving the build again
* Added .NET packaging for NuGet * Version number generation * NuGet metadata
1 parent 9bda507 commit fdbbbe6

15 files changed

Lines changed: 69 additions & 6 deletions

File tree

.github/workflows/dotnetCi.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313

1414
env:
1515
RunNumber: ${{ github.run_number }}.${{ github.run_attempt }}
16+
VersionSuffix: ci.${{ github.run_number }}
1617
SonarCloudProject: csf-dev_CSF.Screenplay
1718
SonarCloudUsername: craigfowler-github
1819
SonarCloudUrl: https://sonarcloud.io
@@ -84,7 +85,7 @@ jobs:
8485
/s:$PWD/.sonarqube-analysisproperties.xml
8586
- name: Build the solution (one TFM only for performance)
8687
run: dotnet build -c ${{ env.Configuration }} --no-incremental -p:TargetFrameworks=${{ env.Tfm }}
87-
- name: Run .NET tests with coverage (one TFM only for performance)
88+
- name: Run .NET tests with coverage
8889
id: dotnet_tests
8990
continue-on-error: true
9091
run: |
@@ -93,7 +94,7 @@ jobs:
9394
projNameArray=(${proj//// })
9495
projName=${projNameArray[1]}
9596
assemblyPath=$proj/bin/$Configuration/$Tfm/$projName.dll
96-
coverlet "$assemblyPath" --target "dotnet" --targetargs "test $proj -c $Configuration --no-build -p:TargetFramework=$Tfm --logger:nunit --test-adapter-path:." -f=opencover -o="TestResults/$projName.opencover.xml"
97+
coverlet "$assemblyPath" --target "dotnet" --targetargs "test $proj -c $Configuration --no-build --logger:nunit --test-adapter-path:." -f=opencover -o="TestResults/$projName.opencover.xml"
9798
if [ $? -ne 0 ]
9899
then
99100
echo "failures=true" >> $GITHUB_OUTPUT
@@ -150,8 +151,13 @@ jobs:
150151
151152
# Build the apps in release mode and publish artifacts
152153

153-
- name: Build in release configuration
154-
run: dotnet build -c Release
154+
- name: Build, in release configuration
155+
run: dotnet pack -p:VersionSuffix=$VersionSuffix -o packages
156+
- name: Upload build result artifacts
157+
uses: actions/upload-artifact@v4
158+
with:
159+
name: Build results (NuGet)
160+
path: packages/*.nupkg
155161

156162
# buildDocs:
157163
# TODO: Build the docco site and package the result as an artifact, don't publish it

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ node_modules/
1010
**/ScreenplayReport*
1111
**/TestResult.xml
1212
.obsidian/
13+
packages/

.vscode/tasks.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@
2020
"problemMatcher": [],
2121
"label": "dotnet: build (net8.0 only)"
2222
},
23+
{
24+
"group": {
25+
"kind": "build"
26+
},
27+
"command": "dotnet",
28+
"args": ["pack", "-o", "packages"],
29+
"problemMatcher": [],
30+
"label": "dotnet: pack"
31+
},
32+
{
33+
"group": {
34+
"kind": "none"
35+
},
36+
"command": "dotnet",
37+
"args": ["clean"],
38+
"problemMatcher": [],
39+
"label": "dotnet: clean"
40+
},
2341
{
2442
"group": {
2543
"kind": "test",

CSF.Screenplay.Abstractions/CSF.Screenplay.Abstractions.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<Import Project="..\Tools\MultiTargeting.props" />
4+
<Import Project="..\Tools\Version.props" />
45

56
<PropertyGroup>
67
<RootNamespace>CSF.Screenplay</RootNamespace>
78
<DocumentationFile>$(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
9+
<Description>Abstractions for CSF.Screenplay; useful for authoring Extensions or Performable/Ability logic without dependency on the full CSF.Screenplay package</Description>
810
</PropertyGroup>
911

1012
<ItemGroup>

CSF.Screenplay.Docs/CSF.Screenplay.Docs.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
<Target Name="Clean">
1818
<RemoveDir Directories="$(OutputPath);$(ApiDocsPath)" />
1919
</Target>
20+
<Target Name="Pack"><!-- Intentional no-op --></Target>
2021
</Project>

CSF.Screenplay.JsonToHtmlReport.Template/CSF.Screenplay.JsonToHtmlReport.Template.proj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<TemplateSourceDir>$(MSBuildProjectDirectory)\src</TemplateSourceDir>
55
<OutputPath>$(MSBuildProjectDirectory)\..\CSF.Screenplay.JsonToHtmlReport\template</OutputPath>
66
<TemplateOutputFile>$(OutputPath)\template.html</TemplateOutputFile>
7+
<IsPackable>false</IsPackable>
78
</PropertyGroup>
89

910
<!-- We're not explicitly using anything in this targets file but without it there's an unwanted build warning for the 'Restore' target -->
@@ -44,4 +45,6 @@
4445
<RemoveDir Directories="$(OutputPath)" />
4546
</Target>
4647

48+
<Target Name="Pack"><!-- Intentional no-op --></Target>
49+
4750
</Project>

CSF.Screenplay.JsonToHtmlReport/CSF.Screenplay.JsonToHtmlReport.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<Import Project="..\Tools\Version.props" />
4+
35
<PropertyGroup>
46
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">netcoreapp3.1;net462;netstandard2.0;net6.0;net8.0</TargetFrameworks>
57
<OutputType Condition="'$(TargetFramework)' != 'netstandard2.0'">Exe</OutputType>
@@ -10,6 +12,7 @@
1012
<!-- It's true that netcoreapp3.1 is already long out of support and net6.0 will be soon, but these are only here for backwards compatibility.
1113
This project is multi-targeted and includes up-to-date TFMs -->
1214
<CheckEolTargetFramework>false</CheckEolTargetFramework>
15+
<Description>A tool which produces human-readable HTML-format reports from the JSON-format reports created by CSF.Screenplay</Description>
1316
</PropertyGroup>
1417

1518
<ItemGroup>

CSF.Screenplay.NUnit/CSF.Screenplay.NUnit.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<Import Project="..\Tools\MultiTargeting.props" />
4+
<Import Project="..\Tools\Version.props" />
45

56
<PropertyGroup>
67
<RootNamespace>CSF.Screenplay</RootNamespace>
78
<DocumentationFile>$(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
89
<IsTestProject>false</IsTestProject>
910
<SonarQubeTestProject>false</SonarQubeTestProject>
11+
<Description>A Test Framework Integration for CSF.Screenplay for NUnit 3.6+</Description>
1012
</PropertyGroup>
1113

1214
<ItemGroup>

CSF.Screenplay.Selenium/CSF.Screenplay.Selenium.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<Import Project="..\Tools\MultiTargeting.props" />
4+
<Import Project="..\Tools\Version.props" />
45

56
<PropertyGroup>
67
<RootNamespace>CSF.Screenplay.Selenium</RootNamespace>
78
<DocumentationFile>$(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
9+
<Description>An Extension for CSF.Screenplay providing Abilities &amp; Performables for Selenium WebDriver 4.0+</Description>
810
</PropertyGroup>
911

1012
<ItemGroup>

CSF.Screenplay.SpecFlow/CSF.Screenplay.SpecFlow.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<Import Project="..\Tools\MultiTargeting.props" />
4+
<Import Project="..\Tools\Version.props" />
45

56
<PropertyGroup>
67
<RootNamespace>CSF.Screenplay</RootNamespace>
78
<DocumentationFile>$(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
89
<IsTestProject>false</IsTestProject>
910
<SonarQubeTestProject>false</SonarQubeTestProject>
1011
<AssemblyName>CSF.Screenplay.SpecFlowPlugin</AssemblyName>
12+
<Description>A Test Framework Integration for CSF.Screenplay for the legacy SpecFlow 3.4.3+ (recommendation: Switch to Reqnroll)</Description>
1113
</PropertyGroup>
1214

1315
<ItemGroup>

0 commit comments

Comments
 (0)