Bladeren bron

dotnet pack in CI (#1400)

* dotnet pack in CI

and delete the old build script

* Update appveyor.yml
Rob Hague 1 jaar geleden
bovenliggende
commit
452c1a23ce
7 gewijzigde bestanden met toevoegingen van 21 en 247 verwijderingen
  1. 3 10
      Renci.SshNet.sln
  2. 5 1
      appveyor.yml
  3. 0 163
      build/build.proj
  4. 0 67
      build/sandcastle/SSH.NET.shfbproj
  5. 7 0
      nuget.config
  6. 0 6
      src/.nuget/NuGet.Config
  7. 6 0
      src/Renci.SshNet/Renci.SshNet.csproj

+ 3 - 10
Renci.SshNet.sln

@@ -3,13 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 17
 VisualStudioVersion = 17.5.33326.253
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{2D6CAE62-D053-476F-9BDD-2B1F27FA9C5D}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sandcastle", "sandcastle", "{A6C3FFD3-16A5-44D3-8C1F-3613D6DD17D1}"
-	ProjectSection(SolutionItems) = preProject
-		build\sandcastle\SSH.NET.shfbproj = build\sandcastle\SSH.NET.shfbproj
-	EndProjectSection
-EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Renci.SshNet", "src\Renci.SshNet\Renci.SshNet.csproj", "{2F5F8C90-0BD1-424F-997C-7BC6280919D1}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{04E8CC26-116E-4116-9558-7ED542548E70}"
@@ -19,9 +12,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 		.gitignore = .gitignore
 		appveyor.yml = appveyor.yml
 		CODEOWNERS = CODEOWNERS
+		CONTRIBUTING.md = CONTRIBUTING.md
 		Directory.Build.props = Directory.Build.props
 		global.json = global.json
 		LICENSE = LICENSE
+		nuget.config = nuget.config
 		README.md = README.md
 		stylecop.json = stylecop.json
 		THIRD-PARTY-NOTICES.TXT = THIRD-PARTY-NOTICES.TXT
@@ -84,7 +79,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Renci.SshNet.Benchmarks", "
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Renci.SshNet.IntegrationBenchmarks", "test\Renci.SshNet.IntegrationBenchmarks\Renci.SshNet.IntegrationBenchmarks.csproj", "{6DFC1807-3F44-4302-A302-43F7D887C4E0}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Renci.SshNet.AotCompatibilityTestApp", "test\Renci.SshNet.AotCompatibilityTestApp\Renci.SshNet.AotCompatibilityTestApp.csproj", "{F2E3FC50-4EF4-488C-B3D2-C45E99898D8B}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Renci.SshNet.AotCompatibilityTestApp", "test\Renci.SshNet.AotCompatibilityTestApp\Renci.SshNet.AotCompatibilityTestApp.csproj", "{F2E3FC50-4EF4-488C-B3D2-C45E99898D8B}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -239,8 +234,6 @@ Global
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
-		{2D6CAE62-D053-476F-9BDD-2B1F27FA9C5D} = {04E8CC26-116E-4116-9558-7ED542548E70}
-		{A6C3FFD3-16A5-44D3-8C1F-3613D6DD17D1} = {2D6CAE62-D053-476F-9BDD-2B1F27FA9C5D}
 		{D21A4D03-0AC2-4613-BB6D-74D2D16A72CC} = {04E8CC26-116E-4116-9558-7ED542548E70}
 		{2F4155AA-750A-4D33-B2E6-ED06660016CE} = {04E8CC26-116E-4116-9558-7ED542548E70}
 		{47CAF831-32E1-49AD-8E24-6A8732CC2F35} = {2F4155AA-750A-4D33-B2E6-ED06660016CE}

+ 5 - 1
appveyor.yml

@@ -43,6 +43,7 @@ for:
     - echo build
     - dotnet build Renci.SshNet.sln -c Debug
     - dotnet publish -c Release -r win-x64 /warnaserror .\test\Renci.SshNet.AotCompatibilityTestApp\
+    - dotnet pack -c Release
 
   test_script:
     - ps: echo "Run unit tests for .NET 8.0"
@@ -52,4 +53,7 @@ for:
 
 artifacts:
   - path: artifacts
-    name: artifacts
+    name: TestResults
+
+  - path: src/**/*.nupkg
+  - path: src/**/*.snupkg

+ 0 - 163
build/build.proj

@@ -1,163 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-	<UsingTask TaskName="Zip" AssemblyFile="$(MSBuildThisFileDirectory)target\nuget\packages\$(MSBuildTasksPackageId).$(MSBuildTasksPackageVersion)\tools\MSBuild.Community.Tasks.dll"/>
-	<PropertyGroup>
-		<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
-		<BuildRoot>$(MSBuildThisFileDirectory)</BuildRoot>
-		<NuGetExe>$(BuildRoot)target\nuget\nuget.exe</NuGetExe>
-		<MSBuildTasksPackageId>MSBuildTasks</MSBuildTasksPackageId>
-		<MSBuildTasksPackageVersion>1.5.0.214</MSBuildTasksPackageVersion>
-	</PropertyGroup>
-
-	<ItemGroup>
-		<VisualStudioVersionModern Include="2022">
-			<SolutionFile>$(MSBuildThisFileDirectory)..\Renci.SshNet.sln</SolutionFile>
-			<VisualStudioVersion>17.0</VisualStudioVersion>
-		</VisualStudioVersionModern>
-	</ItemGroup>
-
-	<ItemGroup>
-		<TargetFrameworkModern Include=".NET Framework 4.6.2">
-			<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net462</OutputDirectory>
-			<Moniker>net462</Moniker>
-		</TargetFrameworkModern>
-		<TargetFrameworkModern Include=".NETStandard 2.0">
-			<OutputDirectory>Renci.SshNet\bin\$(Configuration)\netstandard2.0</OutputDirectory>
-			<Moniker>netstandard2.0</Moniker>
-		</TargetFrameworkModern>
-		<TargetFrameworkModern Include=".NETStandard 2.1">
-			<OutputDirectory>Renci.SshNet\bin\$(Configuration)\netstandard2.1</OutputDirectory>
-			<Moniker>netstandard2.1</Moniker>
-		</TargetFrameworkModern>
-		<TargetFrameworkModern Include=".NET 6.0">
-			<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net6.0</OutputDirectory>
-			<Moniker>net6.0</Moniker>
-		</TargetFrameworkModern>
-		<TargetFrameworkModern Include=".NET 7.0">
-			<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net7.0</OutputDirectory>
-			<Moniker>net7.0</Moniker>
-		</TargetFrameworkModern>
-		<TargetFrameworkModern Include=".NET 8.0">
-			<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net8.0</OutputDirectory>
-			<Moniker>net8.0</Moniker>
-		</TargetFrameworkModern>
-	</ItemGroup>
-
-	<Target Name="CleanModern" DependsOnTargets="CleanSolutionModern">
-		<RemoveDir Directories="$(MSBuildThisFileDirectory)target"/>
-	</Target>
-
-	
-	<Target Name="CleanSolutionModern" Outputs="%(VisualStudioVersionModern.Identity)">
-		<ItemGroup>
-			<ProjectToBuild Remove="@(ProjectToBuild)"/>
-			<ProjectToBuild Include="%(VisualStudioVersionModern.SolutionFile)">
-				<Properties>Configuration=Release;VisualStudioVersion=%(VisualStudioVersionModern.VisualStudioVersion)</Properties>
-			</ProjectToBuild>
-		</ItemGroup>
-		<MSBuild Projects="@(ProjectToBuild)" Targets="Clean"/>
-	</Target>
-
-	<Target Name="RestoreNuGetPackagesModern" DependsOnTargets="DownloadNuGet" Outputs="%(VisualStudioVersionModern.Identity)">
-		<Message Text="Restoring nuget packages for '%(VisualStudioVersionModern.SolutionFile)'..." Importance="High"/>
-		<Exec Command="$(NuGetExe) restore &quot;%(VisualStudioVersionModern.SolutionFile)&quot;"/>
-	</Target>
-
-	<Target Name="BuildModern" DependsOnTargets="RestoreNuGetPackagesModern" Outputs="%(VisualStudioVersionModern.Identity)">
-		<ItemGroup>
-			<ProjectToBuild Remove="@(ProjectToBuild)"/>
-			<ProjectToBuild Include="%(VisualStudioVersionModern.SolutionFile)">
-				<Properties>Configuration=Release;VisualStudioVersion=%(VisualStudioVersionModern.VisualStudioVersion)</Properties>
-			</ProjectToBuild>
-		</ItemGroup>
-		<MSBuild Projects="@(ProjectToBuild)" ToolsVersion="%(VisualStudioVersionModern.ToolsVersion)" Targets="Rebuild"/>
-	</Target>
-	
-	<Target Name="Package" DependsOnTargets="CreateNuGetPackage;CreateBinPackage;GenerateHelpFile"/>
-	
-	<Target Name="ValidatePackage" DependsOnTargets="ValidatePackageModern"/>
-
-	<Target Name="ValidatePackageModern" DependsOnTargets="CheckNuGetPackageDirectory" Outputs="%(TargetFrameworkModern.Identity)">
-		<Error Text="The 'Renci.SshNet.dll' file is not available for %(TargetFrameworkModern.Identity) in $(NuGetPackageDirectory)\lib\%(TargetFrameworkModern.Moniker)." Condition="!Exists('$(NuGetPackageDirectory)\lib\%(TargetFrameworkModern.Moniker)\Renci.SshNet.dll')"/>
-		<Error Text="The 'Renci.SshNet.xml' file is not available for %(TargetFrameworkModern.Identity) in $(NuGetPackageDirectory)\lib\%(TargetFrameworkModern.Moniker)." Condition="!Exists('$(NuGetPackageDirectory)\lib\%(TargetFrameworkModern.Moniker)\Renci.SshNet.xml')"/>
-	</Target>
-	
-	<Target Name="CreateNuGetPackage" DependsOnTargets="ValidatePackage;CheckNuGetPackageDirectory;CheckReleaseVersion">
-		<Exec Command="dotnet pack $(MSBuildThisFileDirectory)..\src\Renci.SshNet\Renci.SshNet.csproj --no-build --output &quot;$(MSBuildThisFileDirectory)target&quot;"/>
-	</Target>
-	
-	<Target Name="GenerateHelpFile" DependsOnTargets="CheckReleaseVersion">
-		<Error Text="Please install Sandcastle, and ensure the SHFBROOT environment variable is set." Condition="'$(SHFBROOT)'==''"/>
-		<MSBuild Projects="$(MSBuildThisFileDirectory)sandcastle\SSH.NET.shfbproj"/>
-		<Move SourceFiles="$(MSBuildThisFileDirectory)target\help\SshNet.Help.chm" DestinationFiles="$(MSBuildThisFileDirectory)target\SSH.NET-$(ReleaseVersion)-help.chm"/>
-	</Target>
-
-	<Target Name="PreparePackageModern" DependsOnTargets="BuildModern;CheckNuGetPackageDirectory" Outputs="%(TargetFrameworkModern.Identity)">
-		<ItemGroup>
-			<BuildOutput Remove="@(BuildOutput)"/>
-			<BuildOutput Include="$(MSBuildThisFileDirectory)..\src\%(TargetFrameworkModern.OutputDirectory)\Renci.SshNet.dll"/>
-			<BuildOutput Include="$(MSBuildThisFileDirectory)..\src\%(TargetFrameworkModern.OutputDirectory)\Renci.SshNet.xml"/>
-		</ItemGroup>
-		<Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(NuGetPackageDirectory)\lib\%(TargetFrameworkModern.Moniker)"/>
-	</Target>
-	
-	<Target Name="CreateBinPackage" DependsOnTargets="PrepareMSBuildTasksPackage;ValidatePackage;CheckReleaseVersion;CheckBinaryZipPackageDirectory">
-		<ItemGroup>
-			<Files Remove="@(Files)"/>
-			<Files Include="$(NuGetPackageDirectory)\lib\**\*.*"/>
-			<Files Include="$(MSBuildThisFileDirectory)..\LICENSE"/>
-			<Files Include="$(MSBuildThisFileDirectory)..\THIRD-PARTY-NOTICES.TXT"/>
-		</ItemGroup>
-		<Copy SourceFiles="@(Files)" DestinationFolder="$(BinaryZipPackageDirectory)\%(RecursiveDir)"/>
-		<ItemGroup>
-			<Files Remove="@(Files)"/>
-			<Files Include="$(BinaryZipPackageDirectory)\**"/>
-		</ItemGroup>
-		<Zip ZipFileName="$(MSBuildThisFileDirectory)target\SSH.NET-$(ReleaseVersion)-bin.zip" Files="@(Files)" WorkingDirectory="$(BinaryZipPackageDirectory)"/>
-	</Target>
-	
-	<Target Name="DownloadNuGet">
-		<MakeDir Directories="$(MSBuildThisFileDirectory)target\nuget"/>
-		<DownloadFile
-			Address="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
-			FileName="$(MSBuildThisFileDirectory)target\nuget\nuget.exe"/>
-	</Target>
-	<Target Name="PrepareMSBuildTasksPackage" DependsOnTargets="DownloadNuGet">
-		<Exec Command="$(NuGetExe) install $(MSBuildTasksPackageId) -Version $(MSBuildTasksPackageVersion) -OutputDirectory &quot;$(MSBuildThisFileDirectory)target\nuget\packages&quot; -Verbosity quiet"/>
-	</Target>
-	
-	<Target Name="CheckReleaseVersion" Condition="'$(ReleaseVersion)'==''">
-		<Error Text= "Please specify the version number of the release (using the &quot;ReleaseVersion&quot; property)."/>
-	</Target>
-	
-	<Target Name="CheckNuGetPackageDirectory" DependsOnTargets="CheckReleaseVersion">
-		<PropertyGroup>
-			<NuGetPackageDirectory>$(MSBuildThisFileDirectory)target\nuget-$(ReleaseVersion)</NuGetPackageDirectory>
-		</PropertyGroup>
-	</Target>
-
-	<Target Name="CheckBinaryZipPackageDirectory" DependsOnTargets="CheckReleaseVersion">
-		<PropertyGroup>
-			<BinaryZipPackageDirectory>$(MSBuildThisFileDirectory)target\bin-$(ReleaseVersion)</BinaryZipPackageDirectory>
-		</PropertyGroup>
-	</Target>
-	
-	<UsingTask TaskName="DownloadFile" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
-		<ParameterGroup>
-			<Address ParameterType="System.String" Required="true"/>
-			<FileName ParameterType="System.String" Required="true" />
-		</ParameterGroup>
-		<Task>
-			<Reference Include="System" />
-			<Code Type="Fragment" Language="cs">
-				<![CDATA[
-					// Workaround 'Could not create SSL/TLS secure channel' issue due to TLS 1.1 being
-					// the default on earlier versions of .NET
-					System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
-					// Download file
-					new System.Net.WebClient().DownloadFile(Address, FileName);
-				]]>
-			</Code>
-		</Task>
-	</UsingTask>
-</Project>

+ 0 - 67
build/sandcastle/SSH.NET.shfbproj

@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
-  <PropertyGroup>
-    <!-- A target framework version is required by Visual Studio. It can be any version with a targeting pack installed. -->
-    <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
-    <!-- The configuration and platform will be used to determine which assemblies to include from solution and
-         project documentation sources -->
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{f7266fb1-f50a-4a5b-b35a-5ea8ebdc1be9}</ProjectGuid>
-    <SHFBSchemaVersion>2017.9.26.0</SHFBSchemaVersion>
-    <!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual Studio adds them anyway -->
-    <AssemblyName>Documentation</AssemblyName>
-    <RootNamespace>Documentation</RootNamespace>
-    <Name>Documentation</Name>
-    <!-- SHFB properties -->
-    <FrameworkVersion>.NET Framework 4.6.2</FrameworkVersion>
-    <OutputPath>..\target\help</OutputPath>
-    <HtmlHelpName>SshNet.Help</HtmlHelpName>
-    <Language>en-US</Language>
-    <MaximumGroupParts>2</MaximumGroupParts>
-    <NamespaceGrouping>False</NamespaceGrouping>
-    <SyntaxFilters>C#</SyntaxFilters>
-    <SdkLinkTarget>Blank</SdkLinkTarget>
-    <RootNamespaceContainer>False</RootNamespaceContainer>
-    <PresentationStyle>VS2013</PresentationStyle>
-    <Preliminary>False</Preliminary>
-    <NamingMethod>Guid</NamingMethod>
-    <HelpTitle>SSH.NET Client Library Documentation</HelpTitle>
-    <ContentPlacement>AboveNamespaces</ContentPlacement>
-
-    <DocumentationSources>
-      <DocumentationSource sourceFile="..\..\src\Renci.SshNet\bin\Release\net462\Renci.SshNet.dll" xmlns="" />
-      <DocumentationSource sourceFile="..\..\src\Renci.SshNet\bin\Release\net462\Renci.SshNet.xml" xmlns="" />
-    </DocumentationSources>
-    <MissingTags>Summary, Parameter, Returns, AutoDocumentCtors, TypeParameter, AutoDocumentDispose</MissingTags>
-    <BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
-    <HelpFileFormat>HtmlHelp1</HelpFileFormat>
-    <IndentHtml>False</IndentHtml>
-    <KeepLogFile>False</KeepLogFile>
-    <DisableCodeBlockComponent>False</DisableCodeBlockComponent>
-    <CppCommentsFixup>False</CppCommentsFixup>
-    <CleanIntermediates>True</CleanIntermediates>
-  </PropertyGroup>
-  <!-- There are no properties for these groups.  AnyCPU needs to appear in order for Visual Studio to perform
-             the build.  The others are optional common platform types that may appear. -->
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' ">
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' ">
-  </PropertyGroup>
-  <!-- Import the SHFB build targets -->
-  <Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
-</Project>

+ 7 - 0
nuget.config

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <packageSources>
+    <clear />
+    <add key="nuget" value="https://api.nuget.org/v3/index.json" />
+  </packageSources>
+</configuration>

+ 0 - 6
src/.nuget/NuGet.Config

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-	<config>
-		<add key="repositoryPath" value="../../packages" />
-	</config>
-</configuration>

+ 6 - 0
src/Renci.SshNet/Renci.SshNet.csproj

@@ -22,6 +22,12 @@
     <PackageReleaseNotes>https://github.com/sshnet/SSH.NET/releases/tag/$(Version)</PackageReleaseNotes>
     <IncludeSymbols>True</IncludeSymbols>
     <SymbolPackageFormat>snupkg</SymbolPackageFormat>
+    <EmbedUntrackedSources>true</EmbedUntrackedSources>
+    <PublishRepositoryUrl>true</PublishRepositoryUrl>
+  </PropertyGroup>
+
+  <PropertyGroup Condition="'$(CI)' != ''">
+    <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
   </PropertyGroup>
 
   <PropertyGroup Condition=" $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0')) ">