update<Build>: using Power-Shell instead of cmd to run build script

This commit is contained in:
leo 2020-12-14 11:33:59 +08:00
parent 61fe751f13
commit 81d82630ba
4 changed files with 15 additions and 12 deletions

View file

@ -7,7 +7,7 @@
[发行版](https://gitee.com/sourcegit/SourceGit/releases/) [发行版](https://gitee.com/sourcegit/SourceGit/releases/)
1. `SourceGit.exe`为不包含`.NET 5.0`运行时的可执行文件。如果本机已有`.NET 5.0`可下载使用 1. `SourceGit.exe`为不包含`.NET 5.0`运行时的可执行文件。如果本机已有`.NET 5.0`可下载使用
2. `SourceGit.tar.gz`为`self-contained`包。包含了`.NET 5.0`运行时。 2. `SourceGit.zip`为`self-contained`包。包含了`.NET 5.0`运行时。
## 预览 ## 预览

View file

@ -1,11 +0,0 @@
@echo off
cd src
dotnet publish -c Release -r win-x64 -o ..\publish\SourceGit\ -p:PublishSingleFile=true --self-contained=true
dotnet publish -c Release -r win-x64 -o ..\publish\ -p:PublishSingleFile=true --self-contained=false
tar -C ..\publish -czvf ..\publish\SourceGit.tar.gz SourceGit\*.*
rmdir /S /Q ..\publish\SourceGit
pause

7
build.ps1 Normal file
View file

@ -0,0 +1,7 @@
cd src
dotnet publish -c Release -r win-x64 -o ..\publish\ -p:PublishSingleFile=true -p:PublishTrimmed=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained=true
Compress-Archive -Path ..\publish\SourceGit.exe -DestinationPath ..\publish\SourceGit.zip
del /f /s /q ..\publish\SourceGit.exe
dotnet publish -c Release -r win-x64 -o ..\publish\ -p:PublishSingleFile=true --self-contained=false

View file

@ -16,8 +16,15 @@
<RepositoryType>Public</RepositoryType> <RepositoryType>Public</RepositoryType>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>none</DebugType> <DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols> <DebugSymbols>false</DebugSymbols>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<TrimmerRootAssembly Include="System.Runtime" />
<TrimmerRootAssembly Include="System.Diagnostics.Debug" />
<TrimmerRootAssembly Include="System.Runtime.Extensions" />
</ItemGroup>
</Project> </Project>