Skip to content

Commit 53c8731

Browse files
committed
update build
1 parent 1d20fba commit 53c8731

File tree

9 files changed

+106
-151
lines changed

9 files changed

+106
-151
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ insert_final_newline = true
1111
trim_trailing_whitespace = true
1212

1313
# XML Configuration Files
14-
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct,refactorlog}]
14+
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct,refactorlog,runsettings}]
1515
indent_size = 2
1616

1717
# JSON Files

.github/workflows/dotnet.yml

Lines changed: 84 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
name: Build Project
1+
name: Build
22

33
env:
4-
BUILD_PATH: "${{github.workspace}}/packages"
5-
BUILD_VERSION: "5.0.${{github.run_number}}"
6-
BUILD_INFORMATION: "5.0.${{github.run_number}}+Branch.${{github.ref_name}}.Sha.${{github.sha}}"
4+
DOTNET_NOLOGO: true
5+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
6+
BUILD_PATH: '${{github.workspace}}/artifacts'
7+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
78

89
on:
910
push:
@@ -22,48 +23,82 @@ jobs:
2223
runs-on: ubuntu-latest
2324

2425
steps:
25-
- name: Checkout
26-
uses: actions/checkout@v3
27-
with:
28-
fetch-depth: 0
29-
30-
- name: Setup .NET
31-
uses: actions/setup-dotnet@v3
32-
with:
33-
dotnet-version: 7.0.x
34-
35-
- name: Restore Dependencies
36-
run: dotnet restore
37-
38-
- name: Build Project
39-
run: 'dotnet build --configuration Release --no-restore -p:Version="${{env.BUILD_VERSION}}" -p:InformationalVersion="${{env.BUILD_INFORMATION}}"'
40-
41-
- name: Run Tests
42-
run: 'dotnet test --configuration Release --no-build --no-restore --collect:"XPlat Code Coverage"'
43-
44-
- name: Create Packages
45-
run: 'dotnet pack --configuration Release --include-symbols --include-source --no-build --no-restore -p:Version="${{env.BUILD_VERSION}}" --output "${{env.BUILD_PATH}}"'
46-
47-
- name: Upload Package Artifact
48-
if: success()
49-
uses: actions/upload-artifact@v3
50-
with:
51-
name: Packages
52-
path: "${{env.BUILD_PATH}}"
53-
54-
- name: Publish Packages
55-
if: success() && github.event_name != 'pull_request'
56-
run: |
57-
dotnet nuget add source --username pwelter34 --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/loresoft/index.json"
58-
for package in $(find -name "*.nupkg"); do
59-
echo "${0##*/}": Pushing $package...
60-
dotnet nuget push $package --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
61-
done
62-
63-
- name: Publish Release Packages
64-
if: success() && startsWith(github.ref, 'refs/tags/v')
65-
run: |
66-
for package in $(find -name "*.nupkg"); do
67-
echo "${0##*/}": Pushing $package...
68-
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
69-
done
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Install .NET Core
32+
uses: actions/setup-dotnet@v3
33+
with:
34+
dotnet-version: |
35+
6.0.x
36+
7.0.x
37+
38+
- name: Restore Dependencies
39+
run: dotnet restore
40+
41+
- name: Build Solution
42+
run: dotnet build --no-restore --configuration Release
43+
44+
- name: Run Test
45+
run: dotnet test --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings
46+
47+
- name: Generate Coverage
48+
uses: danielpalme/[email protected]
49+
with:
50+
reports: '${{github.workspace}}/test/*/TestResults/*/coverage.info'
51+
targetdir: ${{env.BUILD_PATH}}
52+
reporttypes: lcov
53+
54+
- name: Report Coverage
55+
if: success()
56+
uses: coverallsapp/github-action@v2
57+
with:
58+
file: artifacts/lcov.info
59+
format: lcov
60+
61+
- name: Create Packages
62+
if: success() && github.event_name != 'pull_request'
63+
run: dotnet pack --configuration Release --include-symbols --include-source --no-build --no-restore --output "${{env.BUILD_PATH}}"
64+
65+
- name: Upload Packages
66+
if: success() && github.event_name != 'pull_request'
67+
uses: actions/upload-artifact@v3
68+
with:
69+
name: packages
70+
path: '${{env.BUILD_PATH}}'
71+
72+
deploy:
73+
runs-on: ubuntu-latest
74+
needs: build
75+
if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))
76+
77+
steps:
78+
- name: Download Artifact
79+
uses: actions/download-artifact@v3
80+
with:
81+
name: packages
82+
83+
- name: Publish Packages GitHub
84+
run: |
85+
for package in $(find -name "*.nupkg"); do
86+
echo "${0##*/}": Pushing $package...
87+
dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
88+
done
89+
90+
- name: Publish Packages feedz
91+
run: |
92+
for package in $(find -name "*.nupkg"); do
93+
echo "${0##*/}": Pushing $package...
94+
dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate
95+
done
96+
97+
- name: Publish Packages Nuget
98+
if: startsWith(github.ref, 'refs/tags/v')
99+
run: |
100+
for package in $(find -name "*.nupkg"); do
101+
echo "${0##*/}": Pushing $package...
102+
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
103+
done
104+

appveyor.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

build/common.props

Lines changed: 0 additions & 39 deletions
This file was deleted.

build/sourcelink.props

Lines changed: 0 additions & 12 deletions
This file was deleted.

build/version.props

Lines changed: 0 additions & 9 deletions
This file was deleted.

coverlet.runsettings

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<RunSettings>
3+
<DataCollectionRunSettings>
4+
<DataCollectors>
5+
<DataCollector friendlyName="XPlat code coverage">
6+
<Configuration>
7+
<Format>lcov</Format>
8+
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute,TestSDKAutoGeneratedCode</ExcludeByAttribute>
9+
<SkipAutoProps>true</SkipAutoProps>
10+
</Configuration>
11+
</DataCollector>
12+
</DataCollectors>
13+
</DataCollectionRunSettings>
14+
</RunSettings>

src/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project>
22

33
<PropertyGroup Label="Package">
4-
<Product>EntityChange</Product>
54
<Description>Library to compare two entity object graphs detecting changes</Description>
65
<Copyright>Copyright © $([System.DateTime]::Now.ToString(yyyy)) LoreSoft</Copyright>
76
<Authors>LoreSoft</Authors>
@@ -31,11 +30,12 @@
3130
</PropertyGroup>
3231

3332
<PropertyGroup>
34-
<Version>5.0.0</Version>
33+
<MinVerTagPrefix>v</MinVerTagPrefix>
3534
</PropertyGroup>
3635

3736
<ItemGroup>
3837
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
38+
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="All" />
3939
</ItemGroup>
4040

4141
<ItemGroup>

test/EntityChange.Tests/EntityChange.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="coverlet.collector" Version="3.2.0">
13+
<PackageReference Include="coverlet.collector" Version="6.0.0">
1414
<PrivateAssets>all</PrivateAssets>
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
</PackageReference>
17-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
18-
<PackageReference Include="FluentAssertions" Version="6.8.0" />
19-
<PackageReference Include="xunit" Version="2.4.2" />
20-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
18+
<PackageReference Include="FluentAssertions" Version="6.11.0" />
19+
<PackageReference Include="xunit" Version="2.5.0" />
20+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
2121
<PrivateAssets>all</PrivateAssets>
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
</PackageReference>

0 commit comments

Comments
 (0)