Skip to content

Commit

Permalink
Merge template/faithlife-build.
Browse files Browse the repository at this point in the history
  • Loading branch information
ejball committed Jul 3, 2024
2 parents 96f0748 + 4a90067 commit 5606146
Show file tree
Hide file tree
Showing 22 changed files with 171 additions and 114 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ resharper_comment_typo_highlighting = none
resharper_identifier_typo_highlighting = none
resharper_string_literal_typo_highlighting = none

[Directory.Packages.props]
insert_final_newline = false

[dotnet-tools.json]
insert_final_newline = false

Expand Down Expand Up @@ -87,6 +90,7 @@ csharp_style_prefer_local_over_anonymous_function = true : suggestion
csharp_style_prefer_not_pattern = true : suggestion
csharp_style_prefer_null_check_over_type_check = true : suggestion
csharp_style_prefer_pattern_matching = true : suggestion
csharp_style_prefer_primary_constructors = true : suggestion
csharp_style_prefer_range_operator = true : suggestion
csharp_style_prefer_switch_expression = true : suggestion
csharp_style_prefer_tuple_swap = true : warning
Expand Down Expand Up @@ -203,7 +207,9 @@ dotnet_diagnostic.IDE0160.severity = suggestion
dotnet_diagnostic.IDE0161.severity = suggestion
dotnet_diagnostic.IDE0170.severity = suggestion
dotnet_diagnostic.IDE0180.severity = warning
dotnet_diagnostic.IDE0290.severity = suggestion
dotnet_diagnostic.IDE1005.severity = suggestion
dotnet_diagnostic.NUnit2045.severity = suggestion
dotnet_diagnostic.SA0001.severity = none
dotnet_diagnostic.SA1003.severity = none
dotnet_diagnostic.SA1008.severity = none
Expand Down Expand Up @@ -326,6 +332,7 @@ resharper_arrange_missing_parentheses_highlighting = hint
resharper_arrange_trailing_comma_in_multiline_lists_highlighting = warning
resharper_comment_typo_highlighting = none
resharper_compare_of_floats_by_equality_operator_highlighting = suggestion
resharper_convert_to_primary_constructor_highlighting = hint
resharper_csharp_align_first_arg_by_paren = false
resharper_csharp_align_linq_query = false
resharper_csharp_align_multiline_argument = false
Expand All @@ -347,6 +354,7 @@ resharper_csharp_indent_anonymous_method_block = false
resharper_csharp_indent_nested_for_stmt = true
resharper_csharp_indent_nested_foreach_stmt = true
resharper_csharp_indent_nested_while_stmt = true
resharper_csharp_indent_raw_literal_string = indent
resharper_csharp_int_align = false
resharper_csharp_keep_existing_arrangement = true
resharper_csharp_nested_ternary_style = simple_wrap
Expand Down
32 changes: 15 additions & 17 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
name: Build

on:
workflow_dispatch:
push:
paths-ignore:
- '*.md'
- 'docs/**'
branches:
- 'master'
tags-ignore:
- '**'
branches: [master]
tags-ignore: ['**']
pull_request:
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1

defaults:
run:
shell: pwsh

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
8.0.x
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
fetch-depth: 0 # required to publish docs
- name: Restore
run: .\build.ps1 restore
- name: Build
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Docs

on:
workflow_dispatch:

env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1

defaults:
run:
shell: pwsh

jobs:
publish-docs:
runs-on: windows-latest
steps:
- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
8.0.x
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0 # required to publish docs
- name: Publish Docs
env:
BUILD_BOT_PASSWORD: ${{ secrets.BUILD_BOT_PASSWORD }}
run: .\build.ps1 publish --no-test --trigger publish-docs
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
.vs/
.idea/
artifacts/
bin/
obj/
release/
.vs/
.idea/
Thumbs.db

*.cache
*.user
*.userprefs
*.log
*.ncrunchproject
*.ncrunchsolution
*.user
launchSettings.json
nCrunchTemp*
_ReSharper*
.DS_Store
launchSettings.json
22 changes: 9 additions & 13 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

<PropertyGroup>
<VersionPrefix>2.5.0</VersionPrefix>
<LangVersion>11.0</LangVersion>
<PackageValidationBaselineVersion>2.5.0</PackageValidationBaselineVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>$(NoWarn);1591;1998;NU1507;NU5105</NoWarn>
<NeutralLanguage>en-US</NeutralLanguage>
<NoWarn>$(NoWarn);1591;1998;NU5105</NoWarn>
<DebugType>embedded</DebugType>
<GitHubOrganization>FacilityApi</GitHubOrganization>
<RepositoryName>FacilitySwagger</RepositoryName>
Expand All @@ -20,26 +21,21 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<AnalysisLevel>latest-all</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>false</IsPackable>
<IsTestProject>false</IsTestProject>
<SelfContained>false</SelfContained>
<UseArtifactsOutput>true</UseArtifactsOutput>
<EnableStrictModeForCompatibleFrameworksInPackageValidation>true</EnableStrictModeForCompatibleFrameworksInPackageValidation>
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
<DisablePackageBaselineValidation Condition=" $(PackageValidationBaselineVersion) == $(VersionPrefix) or $(PackageValidationBaselineVersion) == '0.0.0' ">true</DisablePackageBaselineValidation>
</PropertyGroup>

<PropertyGroup Condition=" '$(BuildNumber)' != '' ">
<AssemblyVersion>$(VersionPrefix).$(BuildNumber)</AssemblyVersion>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup>
<FacilityVersion>2.11.0</FacilityVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Faithlife.Analyzers" Version="1.4.0" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers" />
</ItemGroup>

</Project>
21 changes: 21 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Facility.CodeGen.Console" Version="2.11.0" />
<PackageVersion Include="Facility.Definition" Version="2.11.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.2" />
<PackageVersion Include="NUnit" Version="4.1.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="XmlDocMarkdown.Core" Version="2.9.0" />
<PackageVersion Include="YamlDotNet" Version="12.3.1" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="Faithlife.Analyzers" Version="1.5.0" />
<GlobalPackageReference Include="NUnit.Analyzers" Version="4.2.0" />
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
</ItemGroup>
</Project>
12 changes: 7 additions & 5 deletions FacilitySwagger.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
build.ps1 = build.ps1
.github\workflows\build.yaml = .github\workflows\build.yaml
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
example\ExampleApi.fsd = example\ExampleApi.fsd
global.json = global.json
LICENSE = LICENSE
nuget.config = nuget.config
README.md = README.md
Expand All @@ -24,7 +26,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fsdgenswagger", "src\fsdgen
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Facility.Definition.Swagger.UnitTests", "tests\Facility.Definition.Swagger.UnitTests\Facility.Definition.Swagger.UnitTests.csproj", "{61444245-9A0C-46AE-BA11-54CC6B1F3CB4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "tools\Build\Build.csproj", "{1E0BD797-ACF7-478C-B470-9EF4A825097F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "tools\Build\Build.csproj", "{9D6DC519-8908-4D3A-B16B-118D682BD170}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XmlDocGen", "tools\XmlDocGen\XmlDocGen.csproj", "{636E5B36-4AA8-47D8-884C-AE4D80B49A14}"
EndProject
Expand All @@ -46,10 +48,10 @@ Global
{61444245-9A0C-46AE-BA11-54CC6B1F3CB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61444245-9A0C-46AE-BA11-54CC6B1F3CB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61444245-9A0C-46AE-BA11-54CC6B1F3CB4}.Release|Any CPU.Build.0 = Release|Any CPU
{1E0BD797-ACF7-478C-B470-9EF4A825097F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E0BD797-ACF7-478C-B470-9EF4A825097F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E0BD797-ACF7-478C-B470-9EF4A825097F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E0BD797-ACF7-478C-B470-9EF4A825097F}.Release|Any CPU.Build.0 = Release|Any CPU
{9D6DC519-8908-4D3A-B16B-118D682BD170}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D6DC519-8908-4D3A-B16B-118D682BD170}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D6DC519-8908-4D3A-B16B-118D682BD170}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D6DC519-8908-4D3A-B16B-118D682BD170}.Release|Any CPU.Build.0 = Release|Any CPU
{636E5B36-4AA8-47D8-884C-AE4D80B49A14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{636E5B36-4AA8-47D8-884C-AE4D80B49A14}.Debug|Any CPU.Build.0 = Debug|Any CPU
{636E5B36-4AA8-47D8-884C-AE4D80B49A14}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright 2022 Ed Ball
Copyright 2024 Ed Ball

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 3 additions & 8 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
$ErrorActionPreference = 'Stop'
Push-Location $PSScriptRoot
try {
if (-not (Test-Path ./tools/bin/Build) -or
(Get-ChildItem ./tools/Build/* | Measure-Object LastWriteTime -Maximum).Maximum -gt
(Get-ChildItem ./tools/bin/Build/* | Measure-Object LastWriteTime -Maximum).Maximum) {
if (Test-Path ./tools/bin/Build) { Remove-Item ./tools/bin/Build -Recurse }
dotnet publish ./tools/Build/Build.csproj --output ./tools/bin/Build --nologo --verbosity quiet
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
dotnet ./tools/bin/Build/Build.dll $args
dotnet publish ./tools/Build/Build.csproj --artifacts-path ./artifacts --nologo --verbosity quiet
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
dotnet ./artifacts/publish/Build/release/Build.dll $args
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
finally {
Expand Down
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestFeature"
}
}
3 changes: 2 additions & 1 deletion nuget.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Facility.Definition" Version="$(FacilityVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="YamlDotNet" Version="12.3.1" />
<PackageReference Include="Facility.Definition" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="YamlDotNet" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 5606146

Please sign in to comment.