build: use Powershell script instead of batch file to generate packages on Windows and remove dependency of 7z (#43)

This commit is contained in:
leo 2024-04-01 15:27:55 +08:00
parent 7e28c0904d
commit 54b9c420c1
3 changed files with 15 additions and 5 deletions

View file

@ -1,5 +0,0 @@
rmdir /S /Q SourceGit
dotnet publish ..\src\SourceGit\SourceGit.csproj -c Release -r win-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
resources\7z.exe a SourceGit.win-x64.zip SourceGit "-xr!en/" "-xr!zh/" "-xr!*.pdb"
rmdir /S /Q SourceGit

15
build/build.windows.ps1 Normal file
View file

@ -0,0 +1,15 @@
if (Test-Path SourceGit) {
Remove-Item SourceGit -Recurse -Force
}
if (Test-Path SourceGit.win-x64.zip) {
Remove-Item SourceGit.win-x64.zip -Force
}
dotnet publish ..\src\SourceGit\SourceGit.csproj -c Release -r win-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
Remove-Item SourceGit\*.pdb -Force
Remove-Item SourceGit\zh -Recurse -Force
Remove-Item SourceGit\en -Recurse -Force
Compress-Archive -Path SourceGit -DestinationPath SourceGit.win-x64.zip

Binary file not shown.