Skip to content

Commit

Permalink
自动构建脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
SlimeNull committed Jun 26, 2024
1 parent 1a4eb7e commit a38a6de
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ bld/
[Oo]ut/
[Ll]og/
[Ll]ogs/
[Bb]uilds/

# Visual Studio 2015/2017 cache/options directory
.vs/
Expand Down
2 changes: 1 addition & 1 deletion Sdcb.FFmpeg/Sdcb.FFmpeg.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Description>FFmpeg auto generated unsafe bindings for C#/.NET and Mono.</Description>
<Nullable>enable</Nullable>
<LangVersion>11</LangVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion Sn.ScreenBroadcaster/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Input;
Expand Down
59 changes: 59 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Write-Host "Sn.ScreenBroadcaster Build Script"

New-Item -ItemType Directory -Force "./Builds" > $null
New-Item -ItemType Directory -Force "./Builds/Temp" > $null

dotnet build -c Release ./Sn.ScreenBroadcaster/Sn.ScreenBroadcaster.csproj

# Copy .NET8 Builds
Remove-Item -Force -Recurse "./Builds/Temp/*"
Copy-Item -Force -Recurse "./Sn.ScreenBroadcaster/bin/Release/net8.0-windows/*" "./Builds/Temp"
Remove-Item -Force -Recurse "./Builds/Temp/runtimes/osx"
Remove-Item -Force -Recurse "./Builds/Temp/runtimes/win-arm64"

# Compress .NET8 Full
Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net8-full.zip"

Remove-Item -Force -Recurse "./Builds/Temp/runtimes/win-x86"

# Compress .NET8 X64
Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net8-x64.zip"

# Copy .NET8 Builds
Remove-Item -Force -Recurse "./Builds/Temp/*"
Copy-Item -Force -Recurse "./Sn.ScreenBroadcaster/bin/Release/net8.0-windows/*" "./Builds/Temp"
Remove-Item -Force -Recurse "./Builds/Temp/runtimes/osx"
Remove-Item -Force -Recurse "./Builds/Temp/runtimes/win-arm64"
Remove-Item -Force -Recurse "./Builds/Temp/runtimes/win-x64"

# Compress .NET8 X64
Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net8-x86.zip"

# Copy .NET481 Builds
Remove-Item -Force -Recurse "./Builds/Temp/*"
Copy-Item -Force -Recurse "./Sn.ScreenBroadcaster/bin/Release/net481/*" "./Builds/Temp"
Remove-Item -Force -Recurse "./Builds/Temp/arm64"
Remove-Item -Force -Recurse "./Builds/Temp/*.dylib"

# Compress .NET481 Full
Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net481-full.zip"

Remove-Item -Force -Recurse "./Builds/Temp/x86"
Remove-Item -Force -Recurse "./Builds/Temp/dll/x86"

# Compress .NET481 x64
Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net481-x64.zip"

# Copy .NET481 Builds
Remove-Item -Force -Recurse "./Builds/Temp/*"
Copy-Item -Force -Recurse "./Sn.ScreenBroadcaster/bin/Release/net481/*" "./Builds/Temp"
Remove-Item -Force -Recurse "./Builds/Temp/arm64"
Remove-Item -Force -Recurse "./Builds/Temp/x64"
Remove-Item -Force -Recurse "./Builds/Temp/dll/x64"
Remove-Item -Force -Recurse "./Builds/Temp/*.dylib"

# Compress .NET481 x86
Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net481-x86.zip"

# Cleaning
Remove-Item -Force -Recurse "./Builds/Temp"

0 comments on commit a38a6de

Please sign in to comment.