diff --git a/.editorconfig b/.editorconfig index d8af54d..3129802 100644 --- a/.editorconfig +++ b/.editorconfig @@ -74,4 +74,303 @@ csharp_new_line_before_else = true csharp_new_line_before_catch = true csharp_new_line_before_finally = true csharp_new_line_before_members_in_object_initializers = true -csharp_new_line_before_members_in_anonymous_types = true \ No newline at end of file +csharp_new_line_before_members_in_anonymous_types = true + +# Known validation methods, see https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1062?view=vs-2019#null-check-validation-methods +dotnet_code_quality.CA1062.null_check_validation_methods = ThrowIfNull|ThrowIfNullOrEmpty|ThrowIfNullOrWhiteSpace + +# These rules represent Dave Glick's preferences and enforce consistent code quality guidelines. +[*.{cs,vb}] +dotnet_diagnostic.CA1020.severity = warning +dotnet_diagnostic.CA1021.severity = warning +dotnet_diagnostic.CA1040.severity = warning +dotnet_diagnostic.CA1045.severity = warning +dotnet_diagnostic.CA1062.severity = warning +dotnet_diagnostic.CA1501.severity = warning +dotnet_diagnostic.CA1504.severity = warning +dotnet_diagnostic.CA1505.severity = warning +dotnet_diagnostic.CA1506.severity = none +dotnet_diagnostic.CA1700.severity = warning +dotnet_diagnostic.CA1701.severity = warning +dotnet_diagnostic.CA1702.severity = warning +dotnet_diagnostic.CA1703.severity = warning +dotnet_diagnostic.CA1704.severity = warning +dotnet_diagnostic.CA1707.severity = warning +dotnet_diagnostic.CA1709.severity = warning +dotnet_diagnostic.CA1710.severity = warning +dotnet_diagnostic.CA1711.severity = warning +dotnet_diagnostic.CA1712.severity = warning +dotnet_diagnostic.CA1713.severity = warning +dotnet_diagnostic.CA1714.severity = warning +dotnet_diagnostic.CA1715.severity = warning +dotnet_diagnostic.CA1717.severity = warning +dotnet_diagnostic.CA1719.severity = warning +dotnet_diagnostic.CA1720.severity = warning +dotnet_diagnostic.CA1721.severity = warning +dotnet_diagnostic.CA1722.severity = warning +dotnet_diagnostic.CA1724.severity = none +dotnet_diagnostic.CA1725.severity = warning +dotnet_diagnostic.CA1726.severity = warning +dotnet_diagnostic.CA2204.severity = warning +dotnet_diagnostic.CS1591.severity = none +dotnet_diagnostic.IDE0007.severity = none +dotnet_diagnostic.IDE0007WithoutSuggestion.severity = none +dotnet_diagnostic.IDE0008.severity = warning +dotnet_diagnostic.RCS1001.severity = suggestion +dotnet_diagnostic.RCS1002.severity = none +dotnet_diagnostic.RCS1003.severity = suggestion +dotnet_diagnostic.RCS1004.severity = none +dotnet_diagnostic.RCS1005.severity = silent +dotnet_diagnostic.RCS1006.severity = silent +dotnet_diagnostic.RCS1007.severity = none +dotnet_diagnostic.RCS1008.severity = warning +dotnet_diagnostic.RCS1009.severity = warning +dotnet_diagnostic.RCS1010.severity = none +dotnet_diagnostic.RCS1012.severity = warning +dotnet_diagnostic.RCS1013.severity = none +dotnet_diagnostic.RCS1014.severity = none +dotnet_diagnostic.RCS1015.severity = suggestion +dotnet_diagnostic.RCS1016.severity = none +dotnet_diagnostic.RCS1017.severity = none +dotnet_diagnostic.RCS1018.severity = suggestion +dotnet_diagnostic.RCS1019.severity = none +dotnet_diagnostic.RCS1020.severity = suggestion +dotnet_diagnostic.RCS1021.severity = suggestion +dotnet_diagnostic.RCS1022.severity = none +dotnet_diagnostic.RCS1023.severity = none +dotnet_diagnostic.RCS1024.severity = none +dotnet_diagnostic.RCS1025.severity = none +dotnet_diagnostic.RCS1026.severity = none +dotnet_diagnostic.RCS1027.severity = none +dotnet_diagnostic.RCS1028.severity = none +dotnet_diagnostic.RCS1029.severity = suggestion +dotnet_diagnostic.RCS1030.severity = none +dotnet_diagnostic.RCS1031.severity = suggestion +dotnet_diagnostic.RCS1032.severity = suggestion +dotnet_diagnostic.RCS1033.severity = suggestion +dotnet_diagnostic.RCS1034.severity = silent +dotnet_diagnostic.RCS1035.severity = none +dotnet_diagnostic.RCS1036.severity = suggestion +dotnet_diagnostic.RCS1037.severity = suggestion +dotnet_diagnostic.RCS1038.severity = suggestion +dotnet_diagnostic.RCS1039.severity = silent +dotnet_diagnostic.RCS1040.severity = silent +dotnet_diagnostic.RCS1041.severity = suggestion +dotnet_diagnostic.RCS1042.severity = silent +dotnet_diagnostic.RCS1043.severity = silent +dotnet_diagnostic.RCS1044.severity = warning +dotnet_diagnostic.RCS1045.severity = none +dotnet_diagnostic.RCS1046.severity = none +dotnet_diagnostic.RCS1047.severity = suggestion +dotnet_diagnostic.RCS1048.severity = suggestion +dotnet_diagnostic.RCS1049.severity = suggestion +dotnet_diagnostic.RCS1050.severity = none +dotnet_diagnostic.RCS1051.severity = none +dotnet_diagnostic.RCS1052.severity = none +dotnet_diagnostic.RCS1053.severity = none +dotnet_diagnostic.RCS1054.severity = silent +dotnet_diagnostic.RCS1055.severity = silent +dotnet_diagnostic.RCS1056.severity = none +dotnet_diagnostic.RCS1057.severity = suggestion +dotnet_diagnostic.RCS1058.severity = suggestion +dotnet_diagnostic.RCS1059.severity = warning +dotnet_diagnostic.RCS1060.severity = none +dotnet_diagnostic.RCS1061.severity = silent +dotnet_diagnostic.RCS1062.severity = silent +dotnet_diagnostic.RCS1063.severity = suggestion +dotnet_diagnostic.RCS1064.severity = none +dotnet_diagnostic.RCS1065.severity = none +dotnet_diagnostic.RCS1066.severity = silent +dotnet_diagnostic.RCS1067.severity = none +dotnet_diagnostic.RCS1068.severity = suggestion +dotnet_diagnostic.RCS1069.severity = silent +dotnet_diagnostic.RCS1070.severity = silent +dotnet_diagnostic.RCS1071.severity = silent +dotnet_diagnostic.RCS1072.severity = suggestion +dotnet_diagnostic.RCS1073.severity = suggestion +dotnet_diagnostic.RCS1074.severity = silent +dotnet_diagnostic.RCS1075.severity = none +dotnet_diagnostic.RCS1076.severity = silent +dotnet_diagnostic.RCS1077.severity = suggestion +dotnet_diagnostic.RCS1078.severity = none +dotnet_diagnostic.RCS1079.severity = none +dotnet_diagnostic.RCS1080.severity = suggestion +dotnet_diagnostic.RCS1081.severity = none +dotnet_diagnostic.RCS1082.severity = warning +dotnet_diagnostic.RCS1083.severity = warning +dotnet_diagnostic.RCS1084.severity = suggestion +dotnet_diagnostic.RCS1085.severity = suggestion +dotnet_diagnostic.RCS1086.severity = none +dotnet_diagnostic.RCS1087.severity = none +dotnet_diagnostic.RCS1088.severity = none +dotnet_diagnostic.RCS1089.severity = suggestion +dotnet_diagnostic.RCS1090.severity = suggestion +dotnet_diagnostic.RCS1091.severity = silent +dotnet_diagnostic.RCS1092.severity = none +dotnet_diagnostic.RCS1093.severity = suggestion +dotnet_diagnostic.RCS1094.severity = none +dotnet_diagnostic.RCS1095.severity = suggestion +dotnet_diagnostic.RCS1096.severity = suggestion +dotnet_diagnostic.RCS1097.severity = suggestion +dotnet_diagnostic.RCS1098.severity = suggestion +dotnet_diagnostic.RCS1099.severity = suggestion +dotnet_diagnostic.RCS1100.severity = none +dotnet_diagnostic.RCS1101.severity = none +dotnet_diagnostic.RCS1102.severity = none +dotnet_diagnostic.RCS1103.severity = suggestion +dotnet_diagnostic.RCS1104.severity = suggestion +dotnet_diagnostic.RCS1105.severity = suggestion +dotnet_diagnostic.RCS1106.severity = suggestion +dotnet_diagnostic.RCS1107.severity = suggestion +dotnet_diagnostic.RCS1108.severity = suggestion +dotnet_diagnostic.RCS1109.severity = suggestion +dotnet_diagnostic.RCS1110.severity = suggestion +dotnet_diagnostic.RCS1111.severity = none +dotnet_diagnostic.RCS1112.severity = suggestion +dotnet_diagnostic.RCS1113.severity = suggestion +dotnet_diagnostic.RCS1114.severity = suggestion +dotnet_diagnostic.RCS1115.severity = silent +dotnet_diagnostic.RCS1116.severity = silent +dotnet_diagnostic.RCS1117.severity = silent +dotnet_diagnostic.RCS1118.severity = suggestion +dotnet_diagnostic.RCS1119.severity = suggestion +dotnet_diagnostic.RCS1120.severity = suggestion +dotnet_diagnostic.RCS1121.severity = suggestion +dotnet_diagnostic.RCS1122.severity = none +dotnet_diagnostic.RCS1123.severity = suggestion +dotnet_diagnostic.RCS1124.severity = silent +dotnet_diagnostic.RCS1125.severity = silent +dotnet_diagnostic.RCS1126.severity = none +dotnet_diagnostic.RCS1127.severity = suggestion +dotnet_diagnostic.RCS1128.severity = suggestion +dotnet_diagnostic.RCS1129.severity = silent +dotnet_diagnostic.RCS1130.severity = suggestion +dotnet_diagnostic.RCS1131.severity = silent +dotnet_diagnostic.RCS1132.severity = suggestion +dotnet_diagnostic.RCS1133.severity = silent +dotnet_diagnostic.RCS1134.severity = silent +dotnet_diagnostic.RCS1135.severity = suggestion +dotnet_diagnostic.RCS1136.severity = silent +dotnet_diagnostic.RCS1137.severity = silent +dotnet_diagnostic.RCS1138.severity = warning +dotnet_diagnostic.RCS1139.severity = none +dotnet_diagnostic.RCS1140.severity = silent +dotnet_diagnostic.RCS1141.severity = silent +dotnet_diagnostic.RCS1142.severity = silent +dotnet_diagnostic.RCS1143.severity = silent +dotnet_diagnostic.RCS1144.severity = silent +dotnet_diagnostic.RCS1145.severity = silent +dotnet_diagnostic.RCS1146.severity = suggestion +dotnet_diagnostic.RCS1147.severity = silent +dotnet_diagnostic.RCS1148.severity = silent +dotnet_diagnostic.RCS1149.severity = silent +dotnet_diagnostic.RCS1150.severity = suggestion +dotnet_diagnostic.RCS1151.severity = silent +dotnet_diagnostic.RCS1152.severity = silent +dotnet_diagnostic.RCS1153.severity = none +dotnet_diagnostic.RCS1154.severity = suggestion +dotnet_diagnostic.RCS1155.severity = warning +dotnet_diagnostic.RCS1156.severity = suggestion +dotnet_diagnostic.RCS1157.severity = suggestion +dotnet_diagnostic.RCS1158.severity = suggestion +dotnet_diagnostic.RCS1159.severity = suggestion +dotnet_diagnostic.RCS1160.severity = suggestion +dotnet_diagnostic.RCS1161.severity = silent +dotnet_diagnostic.RCS1162.severity = none +dotnet_diagnostic.RCS1163.severity = suggestion +dotnet_diagnostic.RCS1164.severity = suggestion +dotnet_diagnostic.RCS1165.severity = silent +dotnet_diagnostic.RCS1166.severity = suggestion +dotnet_diagnostic.RCS1167.severity = silent +dotnet_diagnostic.RCS1168.severity = none +dotnet_diagnostic.RCS1169.severity = suggestion +dotnet_diagnostic.RCS1170.severity = suggestion +dotnet_diagnostic.RCS1171.severity = suggestion +dotnet_diagnostic.RCS1172.severity = warning +dotnet_diagnostic.RCS1173.severity = suggestion +dotnet_diagnostic.RCS1174.severity = none +dotnet_diagnostic.RCS1175.severity = suggestion +dotnet_diagnostic.RCS1176.severity = none +dotnet_diagnostic.RCS1177.severity = none +dotnet_diagnostic.RCS1178.severity = suggestion +dotnet_diagnostic.RCS1179.severity = suggestion +dotnet_diagnostic.RCS1180.severity = suggestion +dotnet_diagnostic.RCS1181.severity = silent +dotnet_diagnostic.RCS1182.severity = silent +dotnet_diagnostic.RCS1183.severity = silent +dotnet_diagnostic.RCS1184.severity = none +dotnet_diagnostic.RCS1185.severity = none +dotnet_diagnostic.RCS1186.severity = silent +dotnet_diagnostic.RCS1187.severity = suggestion +dotnet_diagnostic.RCS1188.severity = silent +dotnet_diagnostic.RCS1189.severity = silent +dotnet_diagnostic.RCS1190.severity = suggestion +dotnet_diagnostic.RCS1191.severity = suggestion +dotnet_diagnostic.RCS1192.severity = suggestion +dotnet_diagnostic.RCS1193.severity = warning +dotnet_diagnostic.RCS1194.severity = none +dotnet_diagnostic.RCS1195.severity = suggestion +dotnet_diagnostic.RCS1196.severity = suggestion +dotnet_diagnostic.RCS1197.severity = suggestion +dotnet_diagnostic.RCS1198.severity = none +dotnet_diagnostic.RCS1199.severity = suggestion +dotnet_diagnostic.RCS1200.severity = suggestion +dotnet_diagnostic.RCS1201.severity = silent +dotnet_diagnostic.RCS1202.severity = suggestion +dotnet_diagnostic.RCS1203.severity = warning +dotnet_diagnostic.RCS1204.severity = suggestion +dotnet_diagnostic.RCS1205.severity = suggestion +dotnet_diagnostic.RCS1206.severity = suggestion +dotnet_diagnostic.RCS1207.severity = silent +dotnet_diagnostic.RCS1208.severity = none +dotnet_diagnostic.RCS1209.severity = suggestion +dotnet_diagnostic.RCS1210.severity = warning +dotnet_diagnostic.RCS1211.severity = silent +dotnet_diagnostic.RCS1212.severity = suggestion +dotnet_diagnostic.RCS1213.severity = suggestion +dotnet_diagnostic.RCS1214.severity = suggestion +dotnet_diagnostic.RCS1215.severity = warning +dotnet_diagnostic.RCS1216.severity = suggestion +dotnet_diagnostic.RCS1217.severity = silent +dotnet_diagnostic.RCS1218.severity = suggestion +dotnet_diagnostic.RCS1219.severity = none +dotnet_diagnostic.RCS1220.severity = suggestion +dotnet_diagnostic.RCS1221.severity = suggestion +dotnet_diagnostic.RCS1222.severity = suggestion +dotnet_diagnostic.RCS1223.severity = none +dotnet_diagnostic.RCS1224.severity = suggestion +dotnet_diagnostic.RCS1225.severity = suggestion +dotnet_diagnostic.RCS1226.severity = suggestion +dotnet_diagnostic.RCS1227.severity = suggestion +dotnet_diagnostic.RCS1228.severity = silent +dotnet_diagnostic.RCS1229.severity = suggestion +dotnet_diagnostic.RCS1230.severity = suggestion +dotnet_diagnostic.RCS1231.severity = suggestion +dotnet_diagnostic.SA1101.severity = none +dotnet_diagnostic.SA1118.severity = none +dotnet_diagnostic.SA1200.severity = none +dotnet_diagnostic.SA1201.severity = none +dotnet_diagnostic.SA1202.severity = none +dotnet_diagnostic.SA1204.severity = none +dotnet_diagnostic.SA1210.severity = none +dotnet_diagnostic.SA1309.severity = none +dotnet_diagnostic.SA1413.severity = none +dotnet_diagnostic.SA1512.severity = none +dotnet_diagnostic.SA1513.severity = none +dotnet_diagnostic.SA1516.severity = none +dotnet_diagnostic.SA1600.severity = none +dotnet_diagnostic.SA1601.severity = none +dotnet_diagnostic.SA1602.severity = none +dotnet_diagnostic.SA1604.severity = none +dotnet_diagnostic.SA1605.severity = none +dotnet_diagnostic.SA1606.severity = none +dotnet_diagnostic.SA1607.severity = none +dotnet_diagnostic.SA1608.severity = none +dotnet_diagnostic.SA1611.severity = none +dotnet_diagnostic.SA1615.severity = none +dotnet_diagnostic.SA1618.severity = none +dotnet_diagnostic.SA1623.severity = none +dotnet_diagnostic.SA1633.severity = none +dotnet_diagnostic.SA1642.severity = none +dotnet_diagnostic.SA1648.severity = none +dotnet_diagnostic.SX1309.severity = warning \ No newline at end of file diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..3716652 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: daveaglick diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c024d50 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,38 @@ +name: Build +on: + pull_request: + workflow_dispatch: + push: + branches: + - main +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + env: + # https://github.com/NuGet/Home/issues/11548 + # https://twitter.com/xoofx/status/1488617114940452872?s=20&t=BKSN4j9rP6fOyg8l7aW0eg + NUGET_CERT_REVOCATION_MODE: offline + steps: + - name: Get Source + uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install .NET Core SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: | + 3.1.x + 6.0.x + - name: Build and Test + run: dotnet test --logger "trx;LogFileName=test-results.trx" + - name: Upload Test Results + uses: actions/upload-artifact@v2 + if: success() || failure() + with: + name: test-results-${{ matrix.os }} + path: '**/test-results.trx' \ No newline at end of file diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 0000000..1c1470a --- /dev/null +++ b/.github/workflows/test-report.yml @@ -0,0 +1,21 @@ +name: 'Test Report' +on: + workflow_run: + workflows: [ 'Build' ] + types: + - completed +jobs: + report: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + steps: + - name: Process Test Results + uses: dorny/test-reporter@v1 + with: + artifact: test-results-${{ matrix.os }} + name: 'Test Results (${{ matrix.os }})' + path: '**/*.trx' + reporter: dotnet-trx \ No newline at end of file diff --git a/.gitignore b/.gitignore index 119d533..08752f9 100644 --- a/.gitignore +++ b/.gitignore @@ -296,3 +296,6 @@ docs/config.wyam.dll *.ncrunchsolution *.ncrunchproject + +cache/ +marvin/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4d40230 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "marvin"] + path = marvin + url = https://github.com/daveaglick/Marvin.git diff --git a/Directory.Build.props b/Directory.Build.props index 87c3056..6ecdd38 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,43 +1,38 @@ - + - false - false - false - false - false - false - false - false - false - ../../daveaglick.ruleset - true - true - true - MIT + 1.0.0 + $(NetlifySharpVersion) + $(Version.Split('-')[0]) + $(Version.Split('-')[0]) + Dave Glick and contributors + Dave Glick and contributors A .NET API Client for Netlify. - true - snupkg - true - Copyright © Dave Glick - false - http://netlifysharp.netlify.com/ + icon.png + README.md + https://netlifysharp.netlify.com/ https://github.com/daveaglick/NetlifySharp.git git - icon.png - Dave Glick - 1.0.0 - 1.0.0 - 1.0.0 + MIT + false + true + true + snupkg + true + true + true + true + true - + + + - - all - - - all - + + + + + \ No newline at end of file diff --git a/Files.shproj b/Files.shproj deleted file mode 100644 index 2605c2d..0000000 --- a/Files.shproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - c3d497ea-3113-4ed0-8806-94b20fc235dd - 14.0 - - - - - - - - - - diff --git a/LICENSE b/LICENSE.md similarity index 96% rename from LICENSE rename to LICENSE.md index ec01077..07245a1 100644 --- a/LICENSE +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Dave Glick +Copyright (c) Dave Glick Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/NetlifySharp.sln b/NetlifySharp.sln index 9101f70..f9d0d77 100644 --- a/NetlifySharp.sln +++ b/NetlifySharp.sln @@ -5,16 +5,8 @@ VisualStudioVersion = 16.0.29409.12 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1D456B5E-2874-446C-8CFD-5134FC11ACAF}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{9D82AABF-D396-48F0-BF32-505620D07B21}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Files", "Files.shproj", "{C3D497EA-3113-4ED0-8806-94B20FC235DD}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetlifySharp", "src\NetlifySharp\NetlifySharp.csproj", "{41AF07B8-6EE0-4D1A-9E23-F42689059B9C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{F66FF7CA-79C6-495B-A073-C83B22AFFE51}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetlifySharp.Build", "build\NetlifySharp.Build\NetlifySharp.Build.csproj", "{073ADC33-A84E-470B-8220-89F8FCCD1FC1}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{112DF2B8-84D8-46DA-995B-53D4DC30FBC7}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetlifySharp.Generator", "tools\NetlifySharp.Generator\NetlifySharp.Generator.csproj", "{7A593078-C658-4F01-B5F3-98C6AE646F0B}" @@ -29,10 +21,6 @@ Global {41AF07B8-6EE0-4D1A-9E23-F42689059B9C}.Debug|Any CPU.Build.0 = Debug|Any CPU {41AF07B8-6EE0-4D1A-9E23-F42689059B9C}.Release|Any CPU.ActiveCfg = Release|Any CPU {41AF07B8-6EE0-4D1A-9E23-F42689059B9C}.Release|Any CPU.Build.0 = Release|Any CPU - {073ADC33-A84E-470B-8220-89F8FCCD1FC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {073ADC33-A84E-470B-8220-89F8FCCD1FC1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {073ADC33-A84E-470B-8220-89F8FCCD1FC1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {073ADC33-A84E-470B-8220-89F8FCCD1FC1}.Release|Any CPU.Build.0 = Release|Any CPU {7A593078-C658-4F01-B5F3-98C6AE646F0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7A593078-C658-4F01-B5F3-98C6AE646F0B}.Debug|Any CPU.Build.0 = Debug|Any CPU {7A593078-C658-4F01-B5F3-98C6AE646F0B}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -43,7 +31,6 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {41AF07B8-6EE0-4D1A-9E23-F42689059B9C} = {1D456B5E-2874-446C-8CFD-5134FC11ACAF} - {073ADC33-A84E-470B-8220-89F8FCCD1FC1} = {F66FF7CA-79C6-495B-A073-C83B22AFFE51} {7A593078-C658-4F01-B5F3-98C6AE646F0B} = {112DF2B8-84D8-46DA-995B-53D4DC30FBC7} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/README.md b/README.md index 65b66b9..d2eedeb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,17 @@ # NetlifySharp + A .NET API Client for Netlify -View the docs at [http://netlifysharp.netlify.com/](http://netlifysharp.netlify.com/) for more information. +**NuGet** +* [NetlifySharp](https://www.nuget.org/packages/NetlifySharp/) + +**GitHub** +* [NetlifySharp](https://github.com/daveaglick/NetlifySharp) + +**Donations** + +If you found this library useful, consider [sponsoring more of it on GitHub](https://github.com/sponsors/daveaglick). I promise to use it on something totally frivolous and unrelated. + +[![Sponsor](https://img.shields.io/github/sponsors/daveaglick?style=social&logo=github-sponsors)](https://github.com/sponsors/daveaglick) -(Note: the docs are a bit our of date right now and will be updated soon) +View the docs at [http://netlifysharp.netlify.com/](http://netlifysharp.netlify.com/) for more information. \ No newline at end of file diff --git a/ReleaseNotes.md b/RELEASE.md similarity index 67% rename from ReleaseNotes.md rename to RELEASE.md index b08aa05..52169ba 100644 --- a/ReleaseNotes.md +++ b/RELEASE.md @@ -1,12 +1,16 @@ -# 1.1.0 - -- Added a `NetlifyClient` constructor that does not require an `HttpClient`. -- Added client methods to all model types as appropriate. - -# 1.0.0 - -- Complete rewrite using NSwag to generate entire Open API specification. - -# 0.1.0 - +# 1.1.1 + +- Added a fallback `HttpClient` when `null` is passed to the constructor that accepts one (#4, thanks @MikDal002). + +# 1.1.0 + +- Added a `NetlifyClient` constructor that does not require an `HttpClient`. +- Added client methods to all model types as appropriate. + +# 1.0.0 + +- Complete rewrite using NSwag to generate entire Open API specification. + +# 0.1.0 + - Initial release. \ No newline at end of file diff --git a/build/NetlifySharp.Build/NetlifySharp.Build.csproj b/build/NetlifySharp.Build/NetlifySharp.Build.csproj deleted file mode 100644 index 00e8772..0000000 --- a/build/NetlifySharp.Build/NetlifySharp.Build.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - Exe - netcoreapp3.0 - $(MSBuildProjectDirectory) - $(DefaultItemExcludes);output\**;temp\**;reportgenerator.exe;nuget.exe - - - - - - - - - - - - diff --git a/build/NetlifySharp.Build/Program.cs b/build/NetlifySharp.Build/Program.cs deleted file mode 100644 index 5aa369a..0000000 --- a/build/NetlifySharp.Build/Program.cs +++ /dev/null @@ -1,191 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Octokit; -using Statiq.App; -using Statiq.Common; -using Statiq.Core; - -namespace NetlifySharp.Build -{ - public class Program - { - private const string BuildVersion = nameof(BuildVersion); - private const string BuildProperties = nameof(BuildProperties); - private const string ReleaseNotes = nameof(ReleaseNotes); - - public static async Task Main(string[] args) => await Bootstrapper - .CreateDefaultWithout(args, DefaultFeatures.HostingCommands) - .ConfigureSettings(x => - { - List releaseLines = File.ReadAllLines("../../ReleaseNotes.md").ToList(); - int versionIndex = releaseLines.FindIndex(x => x.StartsWith("#")); - string version = releaseLines[versionIndex].TrimStart('#').Trim(); - string releaseNotes = string.Join( - Environment.NewLine, - releaseLines.Skip(versionIndex + 1).TakeWhile(x => !x.StartsWith("#")).Where(x => !string.IsNullOrWhiteSpace(x))); - if (x.ContainsKey("BUILD_BUILDNUMBER")) - { - version += "-build-" + x["BUILD_BUILDNUMBER"]; - } - x[BuildVersion] = version; - x[BuildProperties] = $"-p:Version={version} -p:AssemblyVersion={version} -p:FileVersion={version}"; - x[ReleaseNotes] = releaseNotes; - }) - .AddPipelines() - .RunAsync(); - - private static DirectoryPath GetBuildPath(IDocument doc, IExecutionContext ctx) => - ctx.FileSystem.GetOutputPath((DirectoryPath)("build/" + doc.Source.Directory.Name)); - - public class Build : Pipeline - { - public Build() - { - ExecutionPolicy = ExecutionPolicy.Manual; - ProcessModules = new ModuleList - { - new ReadFiles("../../../src/*/*.csproj"), - new StartProcess("dotnet") - .WithArgument("build") - .WithArgument(Config.FromDocument(doc => doc.Source.FullPath), true) - .WithArgument("-o", Config.FromDocument((doc, ctx) => GetBuildPath(doc, ctx).FullPath), true) - .WithArgument(Config.FromSetting(BuildProperties)) - .WithSequentialExecution() - .LogOutput() - }; - } - } - - public class Test : Pipeline - { - public Test() - { - ExecutionPolicy = ExecutionPolicy.Manual; - Dependencies.Add(nameof(Build)); - ProcessModules = new ModuleList - { - new ReadFiles("../../../tests/*/*.csproj"), - new StartProcess("dotnet") - .WithArgument("test") - .WithArgument("--no-build") - .WithArgument("--no-restore") - .WithArgument(Config.FromDocument(doc => doc.Source.FullPath)) - .WithArgument("-o", Config.FromDocument((doc, ctx) => GetBuildPath(doc, ctx).FullPath), true) - .WithArgument(Config.FromSetting(BuildProperties)) - .WithArgument("/p:CollectCoverage=true") - .WithArgument(Config.FromSettings(settings => settings.ContainsKey("BUILD_BUILDNUMBER") ? "--test-adapter-path:. --logger:AzurePipelines" : null)) - .WithSequentialExecution() - .LogOutput() - }; - } - } - - public class Pack : Pipeline - { - public Pack() - { - ExecutionPolicy = ExecutionPolicy.Manual; - Dependencies.Add(nameof(Test)); - ProcessModules = new ModuleList - { - new StartProcess("dotnet") - .WithArgument("pack") - .WithArgument("../../src/NetlifySharp/NetlifySharp.csproj", true) - .WithArgument("--no-build") - .WithArgument("--no-restore") - .WithArgument("-o", Config.FromContext(ctx => ctx.FileSystem.GetOutputDirectory("packages").Path.FullPath), true) - .WithArgument(Config.FromSetting(BuildProperties)) - .LogOutput(), - new ReadFiles(Config.FromContext(ctx => $"{ctx.FileSystem.GetOutputDirectory("packages")}/*.nupkg")), - new ExecuteIf(Config.FromContext(ctx => ctx.ContainsKey("DAVIDGLICK_CERTPASS") && ctx.FileSystem.GetRootFile("../../digicert-davidglick.pfx").Exists)) - { - new StartProcess("nuget") - .WithArgument("sign") - .WithArgument(Config.FromDocument(doc => doc.Source.FullPath), true) - .WithArgument("-CertificatePath", Config.FromContext(ctx => ctx.FileSystem.GetRootFile("../../digicert-davidglick.pfx").Path.FullPath), true) - .WithArgument("-CertificatePassword", Config.FromSetting("DAVIDGLICK_CERTPASS"), true) - .WithArgument("-Timestamper", "http://timestamp.digicert.com", true) - .WithArgument("-NonInteractive") - .LogOutput() - } - }; - } - } - - public class Zip : Pipeline - { - public Zip() - { - ExecutionPolicy = ExecutionPolicy.Manual; - Dependencies.Add(nameof(Test)); - ProcessModules = new ModuleList - { - new ReadFiles("../../../src/*/*.csproj"), - new ExecuteModules( - new ExecuteConfig(Config.FromDocument((doc, ctx) => - (object)new CopyFiles("../../../README.md", "../../../ReleaseNotes.md", "../../../LICENSE") - .To(x => Task.FromResult(GetBuildPath(doc, ctx).CombineFile(x.Path.FileName)))))), - new ZipDirectory(Config.FromDocument(GetBuildPath)), - new SetDestination(Config.FromDocument((doc, ctx) => (FilePath)$"zip/{doc.Source.FileNameWithoutExtension}-{ctx.GetString(BuildVersion)}.zip")), - new WriteFiles() - }; - } - } - - public class Publish : Pipeline - { - public Publish() - { - ExecutionPolicy = ExecutionPolicy.Manual; - Deployment = true; - Dependencies.AddRange(nameof(Pack), nameof(Zip)); - OutputModules = new ModuleList - { - new ThrowException(Config.FromSettings(settings => settings.ContainsKey("NUGET_KEY") ? null : "The setting NUGET_KEY is required")), - new ThrowException(Config.FromSettings(settings => settings.ContainsKey("GITHUB_TOKEN") ? null : "The setting GITHUB_TOKEN is required")), - new ExecuteModules - { - new ReadFiles(Config.FromContext(ctx => $"{ctx.FileSystem.GetOutputDirectory("packages")}/*.nupkg")), - new StartProcess("dotnet") - .WithArgument("nuget") - .WithArgument("push") - .WithArgument("--api-key", Config.FromSetting("NUGET_KEY")) - .WithArgument("--source", "https://api.nuget.org/v3/index.json", true) - .WithArgument(Config.FromDocument(doc => doc.Source.FullPath), true) - .WithSequentialExecution() - .LogOutput() - }, - new ExecuteModules - { - new ReadFiles(Config.FromContext(ctx => $"{ctx.FileSystem.GetOutputDirectory("zip")}/*.zip")), - new ExecuteConfig(Config.FromContext(async ctx => - { - GitHubClient github = new GitHubClient(new ProductHeaderValue(nameof(NetlifySharp))); - github.Credentials = new Credentials(ctx.GetString("GITHUB_TOKEN")); - Release release = github.Repository.Release.Create("daveaglick", "NetlifySharp", new NewRelease(ctx.GetString(BuildVersion)) - { - Name = ctx.GetString(BuildVersion), - Body = string.Join(Environment.NewLine, ctx.GetString(ReleaseNotes)), - TargetCommitish = "master" - }).Result; - - foreach (IDocument input in ctx.Inputs) - { - using (Stream stream = input.GetContentStream()) - { - await github.Repository.Release.UploadAsset( - release, - new ReleaseAssetUpload(input.Source.FileName.FullPath, "application/zip", stream, null)); - } - } - })) - } - }; - } - } - } -} diff --git a/daveaglick.ruleset b/daveaglick.ruleset deleted file mode 100644 index d2a2c01..0000000 --- a/daveaglick.ruleset +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/marvin b/marvin new file mode 160000 index 0000000..077fba5 --- /dev/null +++ b/marvin @@ -0,0 +1 @@ +Subproject commit 077fba5d0959e3d0f4098a45b72ca58664ebda09 diff --git a/marvin.cmd b/marvin.cmd new file mode 100644 index 0000000..171a20a --- /dev/null +++ b/marvin.cmd @@ -0,0 +1,6 @@ +@echo off +cd "marvin" +dotnet run -- %* +set exitcode=%errorlevel% +cd %~dp0 +exit /b %exitcode% \ No newline at end of file diff --git a/marvin.yml b/marvin.yml new file mode 100644 index 0000000..b7642a3 --- /dev/null +++ b/marvin.yml @@ -0,0 +1,8 @@ +ProjectSets: + - Name: NetlifySharp + SourceProjects: "src/*/*.csproj" + TestProjects: "tests/*/*.csproj" + GitHubOwner: "daveaglick" + GitHubName: "NetlifySharp" +GitHubToken: => GetString("GITHUB_TOKEN") +NuGetApiKey: => GetString("DAVEAGLICK_NUGET_API_KEY") \ No newline at end of file diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props deleted file mode 100644 index 177dba5..0000000 --- a/tests/Directory.Build.props +++ /dev/null @@ -1,15 +0,0 @@ - - - - ..\..\tests.ruleset - - - - - - - - - - - \ No newline at end of file