Skip to content

Commit

Permalink
只使用.net5
Browse files Browse the repository at this point in the history
  • Loading branch information
xljiulang committed Sep 15, 2021
1 parent 95bb52b commit d87292d
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 64 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
96 changes: 43 additions & 53 deletions FastGithub/FastGithub.csproj
Original file line number Diff line number Diff line change
@@ -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 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="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 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>
<PropertyGroup>
<OutputType>Exe</OutputType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<IsWebConfigTransformDisabled>true</IsWebConfigTransformDisabled>
<ApplicationIcon>app.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
</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="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 Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="appsettings/appsettings.*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
9 changes: 3 additions & 6 deletions pack.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
7 changes: 3 additions & 4 deletions publish.cmd
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit d87292d

Please sign in to comment.