-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INFRASTRUCTURE: Project Initialisation and Setup
- Loading branch information
Showing
14 changed files
with
524 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Remove the line below if you want to inherit .editorconfig settings from higher directories | ||
|
||
# C# or VB files | ||
[*.{cs,vb,ts,tsx}] | ||
guidelines = 120 | ||
|
||
#### Core EditorConfig Options #### | ||
|
||
#Formatting - header template | ||
file_header_template = ---------------------------------------------------------------\nCopyright (c) North East London ICB. All rights reserved.\n--------------------------------------------------------------- | ||
|
||
#sort System.* using directives alphabetically, and place them before other usings | ||
dotnet_sort_system_directives_first = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
############################################################################### | ||
# Set default behavior to automatically normalize line endings. | ||
############################################################################### | ||
* text=auto | ||
|
||
############################################################################### | ||
# Set default behavior for command prompt diff. | ||
# | ||
# This is need for earlier builds of msysgit that does not have it on by | ||
# default for csharp files. | ||
# Note: This is only used by command line | ||
############################################################################### | ||
#*.cs diff=csharp | ||
|
||
############################################################################### | ||
# Set the merge driver for project and solution files | ||
# | ||
# Merging from the command prompt will add diff markers to the files if there | ||
# are conflicts (Merging from VS is not affected by the settings below, in VS | ||
# the diff markers are never inserted). Diff markers may cause the following | ||
# file extensions to fail to load in VS. An alternative would be to treat | ||
# these files as binary and thus will always conflict and require user | ||
# intervention with every merge. To do so, just uncomment the entries below | ||
############################################################################### | ||
#*.sln merge=binary | ||
#*.csproj merge=binary | ||
#*.vbproj merge=binary | ||
#*.vcxproj merge=binary | ||
#*.vcproj merge=binary | ||
#*.dbproj merge=binary | ||
#*.fsproj merge=binary | ||
#*.lsproj merge=binary | ||
#*.wixproj merge=binary | ||
#*.modelproj merge=binary | ||
#*.sqlproj merge=binary | ||
#*.wwaproj merge=binary | ||
|
||
############################################################################### | ||
# behavior for image files | ||
# | ||
# image files are treated as binary by default. | ||
############################################################################### | ||
#*.jpg binary | ||
#*.png binary | ||
#*.gif binary | ||
|
||
############################################################################### | ||
# diff behavior for common document formats | ||
# | ||
# Convert binary document formats to text before diffing them. This feature | ||
# is only available from the command line. Turn it on by uncommenting the | ||
# entries below. | ||
############################################################################### | ||
#*.doc diff=astextplain | ||
#*.DOC diff=astextplain | ||
#*.docx diff=astextplain | ||
#*.DOCX diff=astextplain | ||
#*.dot diff=astextplain | ||
#*.DOT diff=astextplain | ||
#*.pdf diff=astextplain | ||
#*.PDF diff=astextplain | ||
#*.rtf diff=astextplain | ||
#*.RTF diff=astextplain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "nuget" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
commit-message: | ||
prefix: "CONFIG" | ||
labels: | ||
- "dependencies" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- closed | ||
branches: | ||
- main | ||
env: | ||
IS_RELEASE_CANDIDATE: >- | ||
${{ | ||
( | ||
github.event_name == 'pull_request' && | ||
startsWith(github.event.pull_request.title, 'RELEASES:') && | ||
contains(github.event.pull_request.labels.*.name, 'RELEASES') | ||
) | ||
|| | ||
( | ||
github.event_name == 'push' && | ||
startsWith(github.event.head_commit.message, 'RELEASES:') && | ||
github.ref_name == 'RELEASE' | ||
) | ||
}} | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check Out | ||
uses: actions/checkout@v3 | ||
- name: Setup Dot Net Version | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.201 | ||
- name: Restore | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --no-restore | ||
- name: Test | ||
run: dotnet test --no-build --verbosity normal | ||
add_tag: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
if: > | ||
needs.build.result == 'success' && | ||
github.event.pull_request.merged && | ||
github.event.pull_request.base.ref == 'main' && | ||
startsWith(github.event.pull_request.title, 'RELEASES:') && | ||
contains(github.event.pull_request.labels.*.name, 'RELEASES') | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Extract Version Number | ||
id: extract_version | ||
run: |- | ||
echo "version_number=$(grep -oP '(?<=<Version>)[^<]+' NEL.LibPostalClient.Infrastructure/NEL.LibPostalClient.Infrastructure.csproj)" >> $GITHUB_OUTPUT | ||
echo "package_release_notes=$(grep -oP '(?<=<PackageReleaseNotes>)[^<]+' NEL.MESH/NEL.MESH.csproj)" >> $GITHUB_OUTPUT | ||
- name: Print Version Number | ||
run: |- | ||
echo "Release version - ${{ steps.extract_version.outputs.version_number }}" | ||
echo "Release notes - ${{ steps.extract_version.outputs.package_release_notes }}" | ||
- name: Configure Git | ||
run: |- | ||
git config user.name "GitHub Action" | ||
git config user.email "action@github.com" | ||
- name: Authenticate with GitHub | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PAT_FOR_TAGGING }} | ||
- name: Add Release Tag | ||
run: |- | ||
git tag -a "v${{ steps.extract_version.outputs.version_number }}" -m "Release - v${{ steps.extract_version.outputs.version_number }}" | ||
git push origin --tags | ||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT_FOR_TAGGING }} | ||
with: | ||
tag_name: "v${{ steps.extract_version.outputs.version_number }}" | ||
release_name: "Release - v${{ steps.extract_version.outputs.version_number }}" | ||
body: | | ||
### Release - v${{ steps.extract_version.outputs.version_number }} | ||
#### Release Notes | ||
${{ steps.extract_version.outputs.package_release_notes }} | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- add_tag | ||
if: needs.add_tag.result == 'success' | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
- name: Setup .Net | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.201 | ||
- name: Restore | ||
run: dotnet restore | ||
- name: Build Release | ||
run: dotnet build --no-restore --configuration Release | ||
- name: Pack Nuget | ||
run: dotnet pack --configuration Release | ||
env: | ||
NUGET_KEY: ${{ secrets.NUGET_API_KEY }} | ||
- name: Release Task | ||
run: | ||
dotnet nuget push **/bin/Release/**/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...nfrastructure.Tests.Acceptance/NEL.LibPostalClient.Infrastructure.Tests.Acceptance.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>disable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<IsPackable>false</IsPackable> | ||
<IsTestProject>true</IsTestProject> | ||
<Configurations>Debug;Release;Test;Acceptance</Configurations> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="CompareNETObjects" Version="4.79.0" /> | ||
<PackageReference Include="DeepCloner" Version="0.10.4" /> | ||
<PackageReference Include="FluentAssertions" Version="6.10.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" /> | ||
<PackageReference Include="Moq" Version="4.18.4" /> | ||
<PackageReference Include="Tynamix.ObjectFiller" Version="1.5.8" /> | ||
<PackageReference Include="Xeption" Version="2.5.0" /> | ||
<PackageReference Include="xunit" Version="2.4.2" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="coverlet.collector" Version="3.2.0"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\NEL.LibPostalClient\NEL.LibPostalClient.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="local.appsettings.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
|
||
</Project> |
43 changes: 43 additions & 0 deletions
43
...stalClient.Infrastructure.Tests.Unit/NEL.LibPostalClient.Infrastructure.Tests.Unit.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>disable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<IsPackable>false</IsPackable> | ||
<IsTestProject>true</IsTestProject> | ||
<Configurations>Debug;Release;Test;Acceptance</Configurations> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="CompareNETObjects" Version="4.79.0" /> | ||
<PackageReference Include="DeepCloner" Version="0.10.4" /> | ||
<PackageReference Include="FluentAssertions" Version="6.10.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" /> | ||
<PackageReference Include="Moq" Version="4.18.4" /> | ||
<PackageReference Include="Tynamix.ObjectFiller" Version="1.5.8" /> | ||
<PackageReference Include="Xeption" Version="2.5.0" /> | ||
<PackageReference Include="xunit" Version="2.4.2" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="coverlet.collector" Version="3.2.0"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\NEL.LibPostalClient\NEL.LibPostalClient.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="local.appsettings.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.