Skip to content

Commit 759ef70

Browse files
authored
Merge pull request #74 from autofac/feature/update-build
Update build and dependencies
2 parents 52849b4 + 8d59f5d commit 759ef70

File tree

69 files changed

+717
-958
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+717
-958
lines changed

.editorconfig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ csharp_indent_switch_labels = true
3434
csharp_indent_labels = one_less_than_current
3535

3636
; Modifier preferences
37-
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
37+
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:warning
3838

3939
; Avoid this. unless absolutely necessary
4040
dotnet_style_qualification_for_field = false:suggestion
@@ -163,6 +163,7 @@ indent_size = 2
163163

164164
; .NET solution files - match defaults for VS
165165
[*.sln]
166+
end_of_line = crlf
166167
indent_style = tab
167168

168169
; Config - match XML and default nuget.config template
@@ -197,3 +198,7 @@ charset = utf-8-bom
197198
; ReStructuredText - standard indentation format from examples
198199
[*.rst]
199200
indent_size = 2
201+
202+
# YAML - match standard YAML like Kubernetes and GitHub Actions
203+
[*.{yaml,yml}]
204+
indent_size = 2

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
*.gif binary
1515

1616
*.cs text=auto diff=csharp
17-
*.nuspec text=auto
1817
*.vb text=auto
1918
*.resx text=auto
2019
*.c text=auto

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and Test
2+
on:
3+
workflow_call:
4+
secrets:
5+
CODECOV_TOKEN:
6+
description: Token for uploading code coverage metrics to CodeCov.io.
7+
required: true
8+
jobs:
9+
build:
10+
runs-on: windows-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Setup .NET
15+
uses: actions/setup-dotnet@v4
16+
with:
17+
dotnet-version: |
18+
8.0.x
19+
- name: Build and test
20+
run: dotnet msbuild ./default.proj
21+
- name: Upload coverage
22+
uses: codecov/codecov-action@v5
23+
with:
24+
fail_ci_if_error: true
25+
files: artifacts/logs/*/coverage.cobertura.xml
26+
token: ${{ secrets.CODECOV_TOKEN }}
27+
- name: Upload package artifacts
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: packages
31+
path: |
32+
artifacts/packages/*.nupkg
33+
artifacts/packages/*.snupkg

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Continuous Integration
2+
on:
3+
pull_request:
4+
branches:
5+
- develop
6+
- master
7+
push:
8+
branches:
9+
- develop
10+
- master
11+
- feature/*
12+
tags:
13+
- v[0-9]+.[0-9]+.[0-9]+
14+
# If multiple pushes happen quickly in succession, cancel the running build and
15+
# start a new one.
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
jobs:
20+
# Linting
21+
dotnet-format:
22+
uses: ./.github/workflows/dotnet-format.yml
23+
pre-commit:
24+
uses: ./.github/workflows/pre-commit.yml
25+
# Build and test
26+
build:
27+
uses: ./.github/workflows/build.yml
28+
secrets:
29+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
30+
# Publish beta and release packages.
31+
publish:
32+
uses: ./.github/workflows/publish.yml
33+
needs:
34+
- build
35+
- dotnet-format
36+
- pre-commit
37+
if: ${{ github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/v') }}
38+
secrets:
39+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: dotnet format
2+
on:
3+
workflow_call:
4+
jobs:
5+
dotnet-format:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Setup .NET 8
10+
uses: actions/setup-dotnet@v4
11+
with:
12+
dotnet-version: 8.0.x
13+
- name: dotnet format
14+
run: dotnet format Autofac.WebApi.sln --verify-no-changes

.github/workflows/pre-commit.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: pre-commit
2+
on:
3+
workflow_call:
4+
jobs:
5+
pre-commit:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: actions/setup-python@v5
10+
with:
11+
python-version: 3.x
12+
- uses: pre-commit/[email protected]

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish
2+
on:
3+
workflow_call:
4+
secrets:
5+
NUGET_API_KEY:
6+
description: Token for publishing packages to NuGet.
7+
required: true
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Setup .NET
13+
uses: actions/setup-dotnet@v4
14+
with:
15+
dotnet-version: 8.0.x
16+
- name: Download package artifacts
17+
uses: actions/download-artifact@v4
18+
with:
19+
name: packages
20+
path: artifacts/packages
21+
- name: Publish to GitHub Packages
22+
run: |
23+
dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/autofac/index.json"
24+
dotnet nuget push ./artifacts/packages/*.nupkg --skip-duplicate --source github --api-key ${{ secrets.GITHUB_TOKEN }}
25+
dotnet nuget push ./artifacts/packages/*.snupkg --skip-duplicate --source github --api-key ${{ secrets.GITHUB_TOKEN }}
26+
- name: Publish to NuGet
27+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
28+
run: |
29+
dotnet nuget push ./artifacts/packages/*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}

.gitignore

Lines changed: 47 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,40 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33

4+
# Project specific files
5+
artifacts/
6+
47
# User-specific files
58
*.suo
69
*.user
7-
*.docstates
8-
*.cache
9-
*.userprefs
10-
project.lock.json
11-
.vs/
12-
.cr/
13-
[Ii]ndex.dat
14-
[Ss]torage.dat
10+
*.sln.docstates
11+
*.ide
12+
Index.dat
13+
Storage.dat
1514

1615
# Build results
1716
[Dd]ebug/
18-
[Dd]ebugPublic/
1917
[Rr]elease/
20-
[Rr]eleases/
2118
x64/
22-
x86/
23-
bld/
2419
[Bb]in/
2520
[Oo]bj/
26-
[Aa]rtifacts/
2721

28-
# Roslyn cache directories
29-
*.ide/
22+
# Visual Studio 2015 cache/options directory
23+
.dotnet/
24+
.vs/
25+
.cr/
26+
27+
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
28+
!packages/*/build/
3029

3130
# MSTest test Results
3231
[Tt]est[Rr]esult*/
3332
[Bb]uild[Ll]og.*
34-
35-
#NUNIT
36-
*.VisualState.xml
37-
TestResult.xml
38-
39-
# Build Results of an ATL Project
40-
[Dd]ebugPS/
41-
[Rr]eleasePS/
42-
dlldata.c
33+
*.TestResults.xml
34+
results/
4335

4436
*_i.c
4537
*_p.c
46-
*_i.h
4738
*.ilk
4839
*.meta
4940
*.obj
@@ -63,16 +54,12 @@ dlldata.c
6354
*.vssscc
6455
.builds
6556
*.pidb
66-
*.svclog
57+
*.log
6758
*.scc
6859

69-
# Chutzpah Test files
70-
_Chutzpah*
71-
7260
# Visual C++ cache files
7361
ipch/
7462
*.aps
75-
*.ipch
7663
*.ncb
7764
*.opensdf
7865
*.sdf
@@ -83,19 +70,12 @@ ipch/
8370
*.vsp
8471
*.vspx
8572

86-
# TFS 2012 Local Workspace
87-
$tf/
88-
8973
# Guidance Automation Toolkit
9074
*.gpState
9175

9276
# ReSharper is a .NET coding add-in
9377
_ReSharper*/
9478
*.[Rr]e[Ss]harper
95-
*.DotSettings.user
96-
97-
# JustCode is a .NET coding addin-in
98-
.JustCode
9979

10080
# TeamCity is a build add-in
10181
_TeamCity*
@@ -104,16 +84,8 @@ _TeamCity*
10484
*.dotCover
10585

10686
# NCrunch
107-
_NCrunch_*
87+
*.ncrunch*
10888
.*crunch*.local.xml
109-
*.ncrunchsolution
110-
111-
# MightyMoose
112-
*.mm.*
113-
AutoTest.Net/
114-
115-
# Web workbench (sass)
116-
.sass-cache/
11789

11890
# Installshield output folder
11991
[Ee]xpress/
@@ -133,29 +105,13 @@ publish/
133105

134106
# Publish Web Output
135107
*.[Pp]ublish.xml
136-
*.azurePubxml
137-
[Pp]ublish[Pp]rofiles/
138-
# TODO: Comment the next line if you want to checkin your web deploy settings
139-
# but database connection strings (with potential passwords) will be unencrypted
140108
*.pubxml
141-
*.publishproj
142-
143-
# NuGet Packages
144-
*.nupkg
145-
# The packages folder can be ignored because of Package Restore
146-
**/packages/*
147-
# except build/, which is used as an MSBuild target.
148-
!**/packages/build/
149-
# Don't check in NuGet proper
150-
.nuget/
151-
nuget.exe
152-
# If using the old MSBuild-Integrated Package Restore, uncomment this:
153-
#!**/packages/repositories.config
154-
# Local filesystem/test NuGet
155-
local-nuget/
109+
110+
# NuGet Packages Directory
111+
packages/
156112

157113
# Windows Azure Build Output
158-
csx/
114+
csx
159115
*.build.csdef
160116

161117
# Windows Store app package directory
@@ -165,39 +121,49 @@ AppPackages/
165121
sql/
166122
*.Cache
167123
ClientBin/
124+
[Ss]tyle[Cc]op.*
125+
!stylecop.json
168126
~$*
169127
*~
170128
*.dbmdl
171-
*.dbproj.schemaview
172129
*.pfx
173130
*.publishsettings
174131
node_modules/
132+
bower_components/
133+
wwwroot/
134+
project.lock.json
135+
*.Designer.cs
175136

176137
# RIA/Silverlight projects
177138
Generated_Code/
178139

179-
# Backup & report files from converting an old project file
180-
# to a newer Visual Studio version. Backup files are not needed,
181-
# because we have git ;-)
140+
# Backup & report files from converting an old project file to a newer
141+
# Visual Studio version. Backup files are not needed, because we have git ;-)
182142
_UpgradeReport_Files/
183143
Backup*/
184144
UpgradeLog*.XML
185145
UpgradeLog*.htm
186146

187147
# SQL Server files
188-
*.mdf
189-
*.ldf
148+
App_Data/*.mdf
149+
App_Data/*.ldf
150+
151+
# =========================
152+
# Windows detritus
153+
# =========================
154+
155+
# Windows image file caches
156+
Thumbs.db
157+
ehthumbs.db
190158

191-
# Business Intelligence projects
192-
*.rdl.data
193-
*.bim.layout
194-
*.bim_*.settings
159+
# Folder config file
160+
Desktop.ini
195161

196-
# Microsoft Fakes
197-
FakesAssemblies/
162+
# Recycle Bin used on file shares
163+
$RECYCLE.BIN/
198164

199-
# Mac OS
200-
*DS_Store
165+
# Mac crap
166+
.DS_Store
201167

202168
# JetBrains Rider
203-
.idea/
169+
.idea

.markdownlint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"MD013": false
3+
}

0 commit comments

Comments
 (0)