增加.net5发布以支持win7 #16

This commit is contained in:
xljiulang 2021-07-29 20:49:10 +08:00
parent a81c868bd6
commit 566930208b
7 changed files with 50 additions and 44 deletions

View File

@ -5,7 +5,7 @@
<Description>github加速神器</Description> <Description>github加速神器</Description>
<Copyright>https://github.com/dotnetcore/FastGithub</Copyright> <Copyright>https://github.com/dotnetcore/FastGithub</Copyright>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<TargetFramework>net6.0</TargetFramework> <TargetFrameworks>net5.0;net6.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'"> <PropertyGroup Condition="'$(Configuration)'=='Release'">

View File

@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0-*" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0-*" /> <PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DNS" Version="6.1.0" /> <PackageReference Include="DNS" Version="6.1.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-*" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\FastGithub.Configuration\FastGithub.Configuration.csproj" /> <ProjectReference Include="..\FastGithub.Configuration\FastGithub.Configuration.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.0-*" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-*" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
<PackageReference Include="DNS" Version="6.1.0" /> <PackageReference Include="DNS" Version="6.1.0" />
<ProjectReference Include="..\FastGithub.Configuration\FastGithub.Configuration.csproj" /> <ProjectReference Include="..\FastGithub.Configuration\FastGithub.Configuration.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -1,39 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework> <PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageLicenseExpression>MIT</PackageLicenseExpression> <IsWebConfigTransformDisabled>true</IsWebConfigTransformDisabled>
<IsWebConfigTransformDisabled>true</IsWebConfigTransformDisabled> <ApplicationIcon>app.ico</ApplicationIcon>
<ApplicationIcon>app.ico</ApplicationIcon> <ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationManifest>app.manifest</ApplicationManifest> </PropertyGroup>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
</PropertyGroup>
<ItemGroup> <PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="PInvoke.AdvApi32" Version="0.7.104" /> <EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" /> </PropertyGroup>
<ProjectReference Include="..\FastGithub.Dns\FastGithub.Dns.csproj" />
<ProjectReference Include="..\FastGithub.DomainResolve\FastGithub.DomainResolve.csproj" />
<ProjectReference Include="..\FastGithub.ReverseProxy\FastGithub.ReverseProxy.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="../README.md" Link="README.md"> <PackageReference Include="PInvoke.AdvApi32" Version="0.7.104" />
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
</None> <ProjectReference Include="..\FastGithub.Dns\FastGithub.Dns.csproj" />
</ItemGroup> <ProjectReference Include="..\FastGithub.DomainResolve\FastGithub.DomainResolve.csproj" />
<ProjectReference Include="..\FastGithub.ReverseProxy\FastGithub.ReverseProxy.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Update="appsettings.*"> <None Include="../README.md" Link="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'osx-x64'"> <ItemGroup>
<None Include="../@libs/osx-x64/libSystem.Security.Cryptography.Native.Apple.dylib" Link="libSystem.Security.Cryptography.Native.Apple.dylib"> <None Update="appsettings.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'osx-x64'">
<None Include="../@libs/osx-x64/libSystem.Security.Cryptography.Native.Apple.dylib" Link="libSystem.Security.Cryptography.Native.Apple.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

View File

@ -11,5 +11,8 @@ chmod 777 ./osx-x64/dnscrypt-proxy
chmod 777 ./osx-x64/FastGithub chmod 777 ./osx-x64/FastGithub
zip -r osx-x64.zip osx-x64 zip -r osx-x64.zip osx-x64
# windows-x64 # win10-x64
zip -r win-x64.zip win-x64 -x "./win-x64/aspnetcorev2_inprocess.dll" zip -r win10-x64.zip win10-x64 -x "./win-x64/aspnetcorev2_inprocess.dll"
# win7-x64
zip -r win7-x64.zip win7-x64

View File

@ -1,6 +1,7 @@
cd ./FastGithub cd ./FastGithub
set output=./bin/publish set output=./bin/publish
if exist "%output%" rd /S /Q "%output%" if exist "%output%" rd /S /Q "%output%"
dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true -r win-x64 -o "%output%/win-x64" dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true -f net6.0 -r win-x64 -o "%output%/win10-x64"
dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true -r linux-x64 -o "%output%/linux-x64" dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=false -f net5.0 -r win-x64 -o "%output%/win7-x64"
dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true -r osx-x64 -o "%output%/osx-x64" dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true -f net6.0 -r linux-x64 -o "%output%/linux-x64"
dotnet publish -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true -f net6.0 -r osx-x64 -o "%output%/osx-x64"