只使用.net5

This commit is contained in:
陈国伟 2021-09-15 11:02:04 +08:00
parent 95bb52b7f8
commit d87292dc38
5 changed files with 46 additions and 60 deletions

View File

@ -5,7 +5,7 @@
<Description>github加速神器</Description>
<Copyright>https://github.com/dotnetcore/FastGithub</Copyright>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<TargetFramework>net5.0</TargetFramework>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
</PropertyGroup>

View File

@ -1,57 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<IsWebConfigTransformDisabled>true</IsWebConfigTransformDisabled>
<ApplicationIcon>app.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<IsWebConfigTransformDisabled>true</IsWebConfigTransformDisabled>
<ApplicationIcon>app.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="PInvoke.AdvApi32" Version="0.7.104" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
<ProjectReference Include="..\FastGithub.Dns\FastGithub.Dns.csproj" />
<ProjectReference Include="..\FastGithub.DomainResolve\FastGithub.DomainResolve.csproj" />
<ProjectReference Include="..\FastGithub.ReverseProxy\FastGithub.ReverseProxy.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="PInvoke.AdvApi32" Version="0.7.104" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
<ProjectReference Include="..\FastGithub.Dns\FastGithub.Dns.csproj" />
<ProjectReference Include="..\FastGithub.DomainResolve\FastGithub.DomainResolve.csproj" />
<ProjectReference Include="..\FastGithub.ReverseProxy\FastGithub.ReverseProxy.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.2.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.2.0" />
</ItemGroup>
<ItemGroup>
<None Include="../README.md" Link="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="../README.html" Link="README.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="../LICENSE" Link="LICENSE">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="../README.md" Link="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="../README.html" Link="README.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="../LICENSE" Link="LICENSE">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="appsettings/appsettings.*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</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>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="appsettings/appsettings.*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@ -1,5 +1,8 @@
#! /bin/bash
cd ./FastGithub/bin/publish
# win-x64
zip -r FastGithub_win-x64.zip FastGithub_win-x64 -x "./FastGithub_win-x64/x86/*" -x "./FastGithub_win-x64/*.pdb"
# linux-x64
chmod 777 ./FastGithub_linux-x64/FastGithub
@ -10,9 +13,3 @@ zip -r FastGithub_linux-x64.zip FastGithub_linux-x64 -x "./FastGithub_linux-x64/
chmod 777 ./FastGithub_osx-x64/FastGithub
chmod 777 ./FastGithub_osx-x64/dnscryptproxy/dnscrypt-proxy
zip -r FastGithub_osx-x64.zip FastGithub_osx-x64 -x "./FastGithub_osx-x64/x64/*" -x "./FastGithub_osx-x64/x86/*" -x "./FastGithub_osx-x64/*.pdb"
# win10-x64
zip -r FastGithub_win10-x64.zip FastGithub_win10-x64 -x "./FastGithub_win10-x64/x86/*" -x "./FastGithub_win10-x64/*.pdb" -x "./FastGithub_win10-x64/aspnetcorev2_inprocess.dll"
# win7-x64
zip -r FastGithub_win7-x64.zip FastGithub_win7-x64 -x "./FastGithub_win7-x64/x86/*" -x "./FastGithub_win7-x64/*.pdb"

View File

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