Skip to content

Commit 7c4cd0a

Browse files
sparkeh9CopilotNick Briscoe
authored
Use span-based read helper for control stream (#50)
* Use span-based read helper for control stream * Override ReadByte for control stream * Merge PR #51 Merge Copilot tests for FtpControlStream * Upgrade CoreFTP to .NET 10 and resolve vulnerable dependencies * Fix CI annotations: resolve SYSLIB0039 and CS0108 warnings * Bump version to 2.0.0 and add NuGet publish workflow --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Nick Briscoe <nick.briscoe@razor.co.uk>
1 parent 2b76bae commit 7c4cd0a

34 files changed

Lines changed: 567 additions & 1837 deletions

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818

1919
- name: Setup .NET
2020
uses: actions/setup-dotnet@v4
21-
21+
with:
22+
dotnet-version: '10.0.x'
2223
- name: Restore dependencies
2324
run: dotnet restore
2425

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: "10.0.x"
22+
23+
- name: Restore dependencies
24+
run: dotnet restore
25+
26+
- name: Build
27+
run: dotnet build CoreFtp.sln --configuration Release --no-restore
28+
29+
- name: Run tests
30+
run: dotnet test --configuration Release --no-build
31+
32+
- name: Pack NuGet package
33+
run: dotnet pack src/CoreFtp/CoreFtp.csproj --no-build --configuration Release
34+
35+
- name: Publish to NuGet.org
36+
run: dotnet nuget push src/CoreFtp/bin/Release/CoreFtp.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

build_log.txt

Lines changed: 123 additions & 0 deletions
Large diffs are not rendered by default.

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "8.0.416"
3+
"version": "10.0.103"
44
}
55
}

restore_log.txt

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Determining projects to restore...
2+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : warning NU1903: Package 'Microsoft.NETCore.App' 1.0.5 has a known high severity vulnerability, https://github.com/advisories/GHSA-7mfr-774f-w5r9
3+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : warning NU1903: Package 'Microsoft.NETCore.App' 1.0.5 has a known high severity vulnerability, https://github.com/advisories/GHSA-8884-xcr4-r68p
4+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: Package xunit.runner.visualstudio 3.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package xunit.runner.visualstudio 3.0.0 supports:
5+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net472 (.NETFramework,Version=v4.7.2)
6+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net6.0 (.NETCoreApp,Version=v6.0)
7+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: Package Microsoft.Extensions.Configuration 9.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Extensions.Configuration 9.0.0 supports:
8+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net462 (.NETFramework,Version=v4.6.2)
9+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net8.0 (.NETCoreApp,Version=v8.0)
10+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net9.0 (.NETCoreApp,Version=v9.0)
11+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0)
12+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: Package Microsoft.Extensions.Configuration.FileExtensions 9.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Extensions.Configuration.FileExtensions 9.0.0 supports:
13+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net462 (.NETFramework,Version=v4.6.2)
14+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net8.0 (.NETCoreApp,Version=v8.0)
15+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net9.0 (.NETCoreApp,Version=v9.0)
16+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0)
17+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: Package Microsoft.Extensions.Configuration.Json 9.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Extensions.Configuration.Json 9.0.0 supports:
18+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net462 (.NETFramework,Version=v4.6.2)
19+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net8.0 (.NETCoreApp,Version=v8.0)
20+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net9.0 (.NETCoreApp,Version=v9.0)
21+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0)
22+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.1 (.NETStandard,Version=v2.1)
23+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: Package Microsoft.Extensions.DependencyInjection 9.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Extensions.DependencyInjection 9.0.0 supports:
24+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net462 (.NETFramework,Version=v4.6.2)
25+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net8.0 (.NETCoreApp,Version=v8.0)
26+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net9.0 (.NETCoreApp,Version=v9.0)
27+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0)
28+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.1 (.NETStandard,Version=v2.1)
29+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: Package Microsoft.Extensions.Configuration.Binder 9.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Extensions.Configuration.Binder 9.0.0 supports:
30+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net462 (.NETFramework,Version=v4.6.2)
31+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net8.0 (.NETCoreApp,Version=v8.0)
32+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net9.0 (.NETCoreApp,Version=v9.0)
33+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0)
34+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: Package Microsoft.Extensions.Logging 9.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Extensions.Logging 9.0.0 supports:
35+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net462 (.NETFramework,Version=v4.6.2)
36+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net8.0 (.NETCoreApp,Version=v8.0)
37+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net9.0 (.NETCoreApp,Version=v9.0)
38+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0)
39+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.1 (.NETStandard,Version=v2.1)
40+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: Package Microsoft.Extensions.Logging.Console 9.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Extensions.Logging.Console 9.0.0 supports:
41+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net462 (.NETFramework,Version=v4.6.2)
42+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net8.0 (.NETCoreApp,Version=v8.0)
43+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net9.0 (.NETCoreApp,Version=v9.0)
44+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0)
45+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: Package Microsoft.Extensions.Logging.Debug 9.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Extensions.Logging.Debug 9.0.0 supports:
46+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net462 (.NETFramework,Version=v4.6.2)
47+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net8.0 (.NETCoreApp,Version=v8.0)
48+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net9.0 (.NETCoreApp,Version=v9.0)
49+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0)
50+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: Package FluentAssertions 7.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package FluentAssertions 7.0.0 supports:
51+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net47 (.NETFramework,Version=v4.7)
52+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net6.0 (.NETCoreApp,Version=v6.0)
53+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0)
54+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.1 (.NETStandard,Version=v2.1)
55+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: Package NSubstitute 5.3.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package NSubstitute 5.3.0 supports:
56+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net462 (.NETFramework,Version=v4.6.2)
57+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - net6.0 (.NETCoreApp,Version=v6.0)
58+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0)
59+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1201: Project CoreFtp is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Project CoreFtp supports:
60+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1201: - net10.0 (.NETCoreApp,Version=v10.0)
61+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1201: - net462 (.NETFramework,Version=v4.6.2)
62+
d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj : error NU1201: - netstandard2.0 (.NETStandard,Version=v2.0)
63+
Failed to restore d:\code\oss\CoreFTP\tests\CoreFtp.Tests.Integration\CoreFtp.Tests.Integration.csproj (in 239 ms).
64+
1 of 2 projects are up-to-date for restore.

src/CoreFtp/CoreFtp.csproj

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,32 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Description>A simple .NET FTP library written entirely in C#, with no external dependencies</Description>
4+
<Description>An FTP library written in C# with no external dependencies</Description>
55
<Copyright>Nick Briscoe 2016</Copyright>
66
<AssemblyTitle>CoreFTP</AssemblyTitle>
7-
<VersionPrefix>1.3.4</VersionPrefix>
7+
88
<Authors>Nick Briscoe</Authors>
9-
<TargetFrameworks>netstandard1.6;net452</TargetFrameworks>
9+
<TargetFrameworks>net10.0;net462;netstandard2.0</TargetFrameworks>
1010
<AssemblyName>CoreFtp</AssemblyName>
1111
<PackageId>CoreFtp</PackageId>
1212
<PackageTags>ftp;core;vnext</PackageTags>
1313
<PackageProjectUrl>https://github.com/sparkeh9/CoreFTP</PackageProjectUrl>
14-
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.6' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
15-
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.6' ">1.6.0</NetStandardImplicitPackageVersion>
1614
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1715
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1816
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
1917
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
20-
<Version>1.4</Version>
18+
<Version>2.0.0</Version>
2119
</PropertyGroup>
2220

2321
<ItemGroup>
24-
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="1.0.2" />
25-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="1.0.2" />
26-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="1.0.2" />
27-
</ItemGroup>
28-
29-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
30-
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
31-
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.4.0" />
32-
<PackageReference Include="System.Threading.Tasks" Version="4.3.0" />
33-
<PackageReference Include="System.Net.Security" Version="4.3.1" />
22+
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.0" />
23+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
24+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
3425
</ItemGroup>
3526

36-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
37-
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
38-
</PropertyGroup>
39-
4027
<Target Name="PostcompileScript" AfterTargets="Build" Condition=" '$(IsCrossTargetingBuild)' != 'true' ">
4128
</Target>
4229

43-
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
44-
<Reference Include="System" />
45-
<Reference Include="Microsoft.CSharp" />
46-
</ItemGroup>
30+
4731

4832
</Project>

src/CoreFtp/FtpClientConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ public class FtpClientConfiguration
2525
Port == Constants.FtpsPort;
2626

2727
public X509CertificateCollection ClientCertificates { get; set; } = new X509CertificateCollection();
28-
public SslProtocols SslProtocols { get; set; } = SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12;
28+
public SslProtocols SslProtocols { get; set; } = SslProtocols.None;
2929
}
3030
}

0 commit comments

Comments
 (0)