Skip to content

Commit 7843e5d

Browse files
committed
Adding nerdbank gitversion
1 parent 4c6fa72 commit 7843e5d

16 files changed

Lines changed: 59 additions & 11 deletions

File tree

.github/workflows/CI.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'docs/**'
77

88
env:
9-
VERSION: 1337.0.0
9+
VERSION: ''
1010
BRANCH: ''
1111

1212
jobs:
@@ -17,6 +17,12 @@ jobs:
1717
- name: Getting branch name
1818
run: echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
1919
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
22+
- uses: dotnet/nbgv@master
23+
with:
24+
setAllVars: true
25+
- run: echo "NBGV_SemVer2 $NBGV_SemVer2"
2026
- name: Update tokens in project files
2127
uses: cschleiden/replace-tokens@v1
2228
with:
@@ -27,9 +33,9 @@ jobs:
2733
- name: Building library
2834
run: |
2935
dotnet restore src
30-
dotnet build src/bunit.core/ -c Release --no-restore -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
31-
dotnet build src/bunit.web/ -c Release --no-restore -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
32-
dotnet build src/bunit.xunit/ -c Release --no-restore -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
36+
dotnet build src/bunit.core/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
37+
dotnet build src/bunit.web/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
38+
dotnet build src/bunit.xunit/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
3339
dotnet build src/bunit.testassets/ -c Release --no-restore
3440
- name: Running unit tests
3541
run: |
@@ -38,12 +44,12 @@ jobs:
3844
dotnet test src/bunit.xunit.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
3945
- name: Creating library package
4046
run: |
41-
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
47+
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
4248
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
4349
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
4450
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
4551
- name: Buidling template package
46-
run: dotnet pack templates/bunit-project/ -c Release -o ${GITHUB_WORKSPACE}/templates -p:version=$VERSION
52+
run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/templates -p:version=$VERSION
4753
- name: Verifying template
4854
run: |
4955
dotnet new --install ${GITHUB_WORKSPACE}/templates/bunit.template.$VERSION.nupkg

.github/workflows/nuget-pack-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ jobs:
5757
- name: Push packages to NuGet.org
5858
run: |
5959
dotnet nuget push ${GITHUB_WORKSPACE}/lib/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
60-
dotnet nuget push ${GITHUB_WORKSPACE}/template/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
60+
dotnet nuget push ${GITHUB_WORKSPACE}/template/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,5 @@ ASALocalRun/
331331
.mfractor/
332332
*.playlist
333333
bunit.docs/log.txt
334+
335+
.store

src/bunit.core/bunit.core.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<RootNamespace>Bunit</RootNamespace>
88
<AssemblyName>Bunit.Core</AssemblyName>
99
</PropertyGroup>
10-
10+
1111
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
1212
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1313
</PropertyGroup>
@@ -38,6 +38,10 @@
3838
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.1" />
3939
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.1" />
4040
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
41+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91">
42+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
43+
<PrivateAssets>all</PrivateAssets>
44+
</PackageReference>
4145
</ItemGroup>
4246

4347
</Project>

templates/bunit-project/bunit.template.csproj renamed to src/bunit.template/bunit.template.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PackageType>Template</PackageType>
55
<PackageId>bunit.template</PackageId>
66
<Title>bUnit Template Projects</Title>
7-
<Authors>Egil Hansen</Authors>
7+
<Authors>Egil Hansen</Authors>
88
<Company>Egil Hansen</Company>
99
<Copyright>Egil Hansen</Copyright>
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -15,7 +15,7 @@
1515
bUnit is a testing library for Blazor Components. You can easily define components under test in C# or Razor syntax and verify outcome using semantic HTML diffing/comparison logic. You can easily interact with and inspect components, trigger event handlers, provide cascading values, inject services, mock IJsRuntime, and perform snapshot testing.
1616

1717
The library's goal is to make it easy to write comprehensive, stable unit tests for Blazor Components/Razor Components. Go to bunit.egilhansen.com to learn more.
18-
</PackageDescription>
18+
</PackageDescription>
1919
<PackageTags>bUnit;razor components;blazor components;unit testing;testing blazor components;blazor server;blazor wasm</PackageTags>
2020
<PackageProjectUrl>https://github.com/egil/bunit</PackageProjectUrl>
2121
<TargetFramework>netstandard2.1</TargetFramework>
@@ -26,6 +26,13 @@
2626
<RootNamespace>Bunit</RootNamespace>
2727
</PropertyGroup>
2828

29+
<ItemGroup>
30+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91">
31+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
32+
<PrivateAssets>all</PrivateAssets>
33+
</PackageReference>
34+
</ItemGroup>
35+
2936
<ItemGroup>
3037
<Content Include="template\**\*" Exclude="template\**\bin\**;template\**\obj\**;template\**\.vs\**" />
3138
<Compile Remove="**\*" />

templates/bunit-project/template/.template.config/dotnetcli.host.json renamed to src/bunit.template/template/.template.config/dotnetcli.host.json

File renamed without changes.

templates/bunit-project/template/.template.config/template.json renamed to src/bunit.template/template/.template.config/template.json

File renamed without changes.

templates/bunit-project/template/Company.BlazorTests1.csproj renamed to src/bunit.template/template/Company.BlazorTests1.csproj

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)