mirror of
https://github.com/imrayya/SRTto3Dsubtitles.git
synced 2026-09-21 10:17:27 +02:00
add publish scripts (PowerShell + bash) for single-command cross-platform builds
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
# Publish all targets for SRTto3Dsubtitles
|
||||
# Usage: ./publish.ps1
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$targets = @(
|
||||
@{ Project = "ConvertSRTto3DASS.Cli"; Runtime = "linux-x64"; Name = "ConvertSRTto3DASS-linux-x64" },
|
||||
@{ Project = "ConvertSRTto3DASS.Cli"; Runtime = "win-x64"; Name = "ConvertSRTto3DASS-win-x64.exe" },
|
||||
@{ Project = "ConvertSRTto3DASS.Cli"; Runtime = "osx-x64"; Name = "ConvertSRTto3DASS-osx-x64" },
|
||||
@{ Project = "ConvertSRTto3DASS.Cli"; Runtime = "osx-arm64"; Name = "ConvertSRTto3DASS-osx-arm64" },
|
||||
@{ Project = "ConvertSRTto3DASS.Gui"; Runtime = "win-x64"; Name = "ConvertSRTto3DASS-GUI-Win-x64.exe" }
|
||||
)
|
||||
|
||||
foreach ($t in $targets) {
|
||||
Write-Host "Publishing $($t.Name)..." -ForegroundColor Cyan
|
||||
dotnet publish $t.Project -c Release -r $t.Runtime `
|
||||
--self-contained false `
|
||||
-p:PublishSingleFile=true `
|
||||
-p:IncludeNativeLibrariesForSelfExtract=true `
|
||||
-p:OutputType=Exe `
|
||||
-p:OutputPath="publish\$($t.Runtime)\"
|
||||
|
||||
$src = "publish\$($t.Runtime)\$($t.Project).exe"
|
||||
$dst = "publish\$($t.Name)"
|
||||
if (Test-Path $src) {
|
||||
Move-Item $src $dst -Force
|
||||
Write-Host " -> $dst" -ForegroundColor Green
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "`nDone! Published files in publish/`n" -ForegroundColor Green
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# Publish all targets for SRTto3Dsubtitles
|
||||
# Usage: ./publish.sh
|
||||
|
||||
set -e
|
||||
|
||||
declare -a targets=(
|
||||
"ConvertSRTto3DASS.Cli:linux-x64:ConvertSRTto3DASS-linux-x64"
|
||||
"ConvertSRTto3DASS.Cli:win-x64:ConvertSRTto3DASS-win-x64.exe"
|
||||
"ConvertSRTto3DASS.Cli:osx-x64:ConvertSRTto3DASS-osx-x64"
|
||||
"ConvertSRTto3DASS.Cli:osx-arm64:ConvertSRTto3DASS-osx-arm64"
|
||||
"ConvertSRTto3DASS.Gui:win-x64:ConvertSRTto3DASS-GUI-Win-x64.exe"
|
||||
)
|
||||
|
||||
rm -rf publish
|
||||
mkdir -p publish
|
||||
|
||||
for entry in "${targets[@]}"; do
|
||||
IFS=':' read -r project runtime name <<< "$entry"
|
||||
|
||||
echo "Publishing $name..."
|
||||
dotnet publish "$project" -c Release -r "$runtime" \
|
||||
--self-contained false \
|
||||
-p:PublishSingleFile=true \
|
||||
-p:IncludeNativeLibrariesForSelfExtract=true \
|
||||
-p:OutputType=Exe \
|
||||
-p:OutputPath="publish/$runtime/"
|
||||
|
||||
src="publish/$runtime/$project.exe"
|
||||
dst="publish/$name"
|
||||
if [ -f "$src" ]; then
|
||||
mv "$src" "$dst"
|
||||
echo " -> $dst"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Done! Published files in publish/"
|
||||
Reference in New Issue
Block a user