Skip to content

Commit 9c7858b

Browse files
committed
update build
1 parent 97e24c7 commit 9c7858b

File tree

4 files changed

+122
-82
lines changed

4 files changed

+122
-82
lines changed

.github/dependabot.yml

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,57 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "github-actions"
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
time: "01:00"
8-
open-pull-requests-limit: 10
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "01:00"
8+
timezone: "America/Chicago"
9+
open-pull-requests-limit: 10
910

10-
- package-ecosystem: nuget
11-
directory: "/"
12-
schedule:
13-
interval: daily
14-
time: "11:00"
15-
open-pull-requests-limit: 10
11+
- package-ecosystem: nuget
12+
directory: "/"
13+
schedule:
14+
interval: daily
15+
time: "02:00"
16+
timezone: "America/Chicago"
17+
open-pull-requests-limit: 10
18+
groups:
19+
Azure:
20+
patterns:
21+
- "Azure.*"
22+
- "Microsoft.Azure.*"
23+
- "Microsoft.Extensions.Azure"
24+
AspNetCoreHealthChecks:
25+
patterns:
26+
- "AspNetCore.HealthChecks.*"
27+
AspNetCore:
28+
patterns:
29+
- "Microsoft.AspNetCore.*"
30+
- "Microsoft.Extensions.Features"
31+
MicrosoftExtensions:
32+
patterns:
33+
- "Microsoft.Extensions.*"
34+
EntityFrameworkCore:
35+
patterns:
36+
- "Microsoft.EntityFrameworkCore.*"
37+
OpenTelemetry:
38+
patterns:
39+
- "OpenTelemetry.*"
40+
Serilog:
41+
patterns:
42+
- "Serilog"
43+
- "Serilog.*"
44+
Hangfire:
45+
patterns:
46+
- "Hangfire"
47+
- "Hangfire.*"
48+
Testcontainers:
49+
patterns:
50+
- "Testcontainers.*"
51+
xUnit:
52+
patterns:
53+
- "xunit"
54+
- "xunit.assert"
55+
- "xunit.core"
56+
- "xunit.extensibility.*"
57+
- "xunit.runner.*"

.github/workflows/dotnet.yml

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

33
env:
44
DOTNET_NOLOGO: true
55
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
6-
BUILD_PATH: '${{github.workspace}}/artifacts'
6+
DOTNET_ENVIRONMENT: github
7+
ASPNETCORE_ENVIRONMENT: github
8+
BUILD_PATH: "${{github.workspace}}/artifacts"
79
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
810

911
on:
@@ -12,85 +14,83 @@ on:
1214
- main
1315
- develop
1416
tags:
15-
- 'v*'
17+
- "v*"
1618
pull_request:
1719
branches:
1820
- main
1921
- develop
2022

2123
jobs:
2224
build:
23-
2425
runs-on: ubuntu-latest
2526

2627
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v4
29-
with:
30-
fetch-depth: 0
31-
32-
- name: Install .NET
33-
uses: actions/setup-dotnet@v4
34-
with:
35-
dotnet-version: 8.0.x
36-
37-
- name: Restore Dependencies
38-
run: dotnet restore
39-
40-
- name: Build Solution
41-
run: 'dotnet build --no-restore --configuration Release'
42-
43-
- name: Run Test
44-
run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings
45-
46-
- name: Report Coverage
47-
if: success()
48-
uses: coverallsapp/github-action@v2
49-
with:
50-
file: "${{github.workspace}}/test/*/TestResults/*/coverage.info"
51-
format: lcov
52-
53-
- name: Create Packages
54-
if: success() && github.event_name != 'pull_request'
55-
run: dotnet pack --configuration Release --include-symbols --include-source --no-build --no-restore --output "${{env.BUILD_PATH}}"
56-
57-
- name: Upload Packages
58-
if: success() && github.event_name != 'pull_request'
59-
uses: actions/upload-artifact@v4
60-
with:
61-
name: packages
62-
path: '${{env.BUILD_PATH}}'
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Install .NET
34+
uses: actions/setup-dotnet@v4
35+
with:
36+
dotnet-version: 8.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 --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings
46+
47+
- name: Report Coverage
48+
if: success()
49+
uses: coverallsapp/github-action@v2
50+
with:
51+
file: "${{github.workspace}}/test/*/TestResults/*/coverage.info"
52+
format: lcov
53+
54+
- name: Create Packages
55+
if: success() && github.event_name != 'pull_request'
56+
run: dotnet pack --configuration Release --no-build --output "${{env.BUILD_PATH}}"
57+
58+
- name: Upload Packages
59+
if: success() && github.event_name != 'pull_request'
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: packages
63+
path: "${{env.BUILD_PATH}}"
6364

6465
deploy:
6566
runs-on: ubuntu-latest
6667
needs: build
6768
if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
6869

6970
steps:
70-
- name: Download Artifact
71-
uses: actions/download-artifact@v4
72-
with:
73-
name: packages
74-
75-
- name: Publish Packages feedz
76-
run: |
77-
for package in $(find -name "*.nupkg"); do
78-
echo "${0##*/}": Pushing $package...
79-
dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate
80-
done
81-
82-
- name: Publish Packages GitHub
83-
run: |
84-
for package in $(find -name "*.nupkg"); do
85-
echo "${0##*/}": Pushing $package...
86-
dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
87-
done
88-
89-
- name: Publish Packages Nuget
90-
if: startsWith(github.ref, 'refs/tags/v')
91-
run: |
92-
for package in $(find -name "*.nupkg"); do
93-
echo "${0##*/}": Pushing $package...
94-
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
95-
done
96-
71+
- name: Download Artifact
72+
uses: actions/download-artifact@v4
73+
with:
74+
name: packages
75+
76+
- name: Publish Packages GitHub
77+
run: |
78+
for package in $(find -name "*.nupkg"); do
79+
echo "${0##*/}": Pushing $package...
80+
dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
81+
done
82+
83+
- name: Publish Packages feedz
84+
run: |
85+
for package in $(find -name "*.nupkg"); do
86+
echo "${0##*/}": Pushing $package...
87+
dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate
88+
done
89+
90+
- name: Publish Packages Nuget
91+
if: startsWith(github.ref, 'refs/tags/v')
92+
run: |
93+
for package in $(find -name "*.nupkg"); do
94+
echo "${0##*/}": Pushing $package...
95+
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
96+
done

coverlet.runsettings

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
<DataCollector friendlyName="XPlat code coverage">
66
<Configuration>
77
<Format>lcov</Format>
8-
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute,TestSDKAutoGeneratedCode</ExcludeByAttribute>
9-
<SkipAutoProps>true</SkipAutoProps>
108
</Configuration>
119
</DataCollector>
1210
</DataCollectors>

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<PropertyGroup Label="Debug">
2020
<DebugType>embedded</DebugType>
2121
<EmbedUntrackedSources>true</EmbedUntrackedSources>
22+
<IncludeSymbols>false</IncludeSymbols>
2223
</PropertyGroup>
2324

2425
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
@@ -38,7 +39,6 @@
3839
</PropertyGroup>
3940

4041
<ItemGroup>
41-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
4242
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />
4343
</ItemGroup>
4444

0 commit comments

Comments
 (0)