Compare commits

...

4 Commits
3.3.0 ... main

Author SHA1 Message Date
Matt Nadareski
75f5498c38 Combine like steps for program publishing 2026-11-13 20:22:48 +01:00
Matt Nadareski
d6cd10f54d Simplify publishing logic 2026-11-13 19:36:14 +01:00
Matt Nadareski
1daafcdb5e Change test frameworks to .NET 10 and 11 only 2026-11-13 16:25:34 +01:00
Matt Nadareski
e3640a9376 Make release builds a separate flag in publish scripts 2026-11-13 14:00:53 +01:00
13 changed files with 80 additions and 214 deletions

View File

@@ -17,8 +17,6 @@ jobs:
uses: actions/setup-dotnet@v5 uses: actions/setup-dotnet@v5
with: with:
dotnet-version: | dotnet-version: |
8.0.x
9.0.x
10.0.x 10.0.x
11.0.x 11.0.x

View File

@@ -12,8 +12,6 @@ jobs:
uses: actions/setup-dotnet@v5 uses: actions/setup-dotnet@v5
with: with:
dotnet-version: | dotnet-version: |
8.0.x
9.0.x
10.0.x 10.0.x
11.0.x 11.0.x

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks> <TargetFrameworks>net10.0;net11.0</TargetFrameworks>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks> <TargetFrameworks>net10.0;net11.0</TargetFrameworks>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks> <TargetFrameworks>net10.0;net11.0</TargetFrameworks>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks> <TargetFrameworks>net10.0;net11.0</TargetFrameworks>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks> <TargetFrameworks>net10.0;net11.0</TargetFrameworks>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks> <TargetFrameworks>net10.0;net11.0</TargetFrameworks>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks> <TargetFrameworks>net10.0;net11.0</TargetFrameworks>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks> <TargetFrameworks>net10.0;net11.0</TargetFrameworks>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks> <TargetFrameworks>net10.0;net11.0</TargetFrameworks>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

View File

@@ -11,12 +11,13 @@
# Optional parameters # Optional parameters
USE_ALL=false USE_ALL=false
INCLUDE_DEBUG=false INCLUDE_DEBUG=false
INCLUDE_RELEASE=false
INCLUDE_UNPUBLISHED=false INCLUDE_UNPUBLISHED=false
NO_BUILD=false NO_BUILD=false
NO_ARCHIVE=false NO_ARCHIVE=false
HAS_VERSION=false HAS_VERSION=false
VERSION="NONE" BUILD_VERSION="NONE"
while getopts "udpbav:" OPTION; do while getopts "udrpbav:" OPTION; do
case $OPTION in case $OPTION in
u) u)
USE_ALL=true USE_ALL=true
@@ -24,6 +25,9 @@ while getopts "udpbav:" OPTION; do
d) d)
INCLUDE_DEBUG=true INCLUDE_DEBUG=true
;; ;;
r)
INCLUDE_RELEASE=true
;;
p) p)
INCLUDE_UNPUBLISHED=true INCLUDE_UNPUBLISHED=true
;; ;;
@@ -35,7 +39,7 @@ while getopts "udpbav:" OPTION; do
;; ;;
v) v)
HAS_VERSION=true HAS_VERSION=true
VERSION=${OPTARG} BUILD_VERSION=${OPTARG}
;; ;;
*) *)
echo "Invalid option provided" echo "Invalid option provided"
@@ -54,10 +58,11 @@ COMMIT=$(git log --pretty=%H -1)
echo "Selected Options:" echo "Selected Options:"
echo " Use all frameworks (-u) $USE_ALL" echo " Use all frameworks (-u) $USE_ALL"
echo " Include debug builds (-d) $INCLUDE_DEBUG" echo " Include debug builds (-d) $INCLUDE_DEBUG"
echo " Include release builds (-r) $INCLUDE_RELEASE"
echo " Include unpublished packages (-p) $INCLUDE_UNPUBLISHED" echo " Include unpublished packages (-p) $INCLUDE_UNPUBLISHED"
echo " No build (-b) $NO_BUILD" echo " No build (-b) $NO_BUILD"
echo " No archive (-a) $NO_ARCHIVE" echo " No archive (-a) $NO_ARCHIVE"
echo " Version (-v) $HAS_VERSION ($VERSION)" echo " Version (-v) $HAS_VERSION ($BUILD_VERSION)"
echo " " echo " "
# Create the build matrix arrays # Create the build matrix arrays
@@ -99,11 +104,11 @@ if [ $NO_BUILD = false ]; then
dotnet pack SabreTools.Wrappers/SabreTools.Wrappers.csproj --output $BUILD_FOLDER dotnet pack SabreTools.Wrappers/SabreTools.Wrappers.csproj --output $BUILD_FOLDER
fi fi
# Build ExtractionTool # Build ExtractionTool and InfoPrint
for FRAMEWORK in "${FRAMEWORKS[@]}"; do for FRAMEWORK in "${FRAMEWORKS[@]}"; do
for RUNTIME in "${RUNTIMES[@]}"; do for RUNTIME in "${RUNTIMES[@]}"; do
# Output the current build # Output the current build
echo "===== Build ExtractionTool - $FRAMEWORK, $RUNTIME =====" echo "===== Build ExtractionTool and InfoPrint - $FRAMEWORK, $RUNTIME ====="
# If we have an invalid combination of framework and runtime # If we have an invalid combination of framework and runtime
if [[ ! $(echo ${VALID_CROSS_PLATFORM_FRAMEWORKS[@]} | fgrep -w $FRAMEWORK) ]]; then if [[ ! $(echo ${VALID_CROSS_PLATFORM_FRAMEWORKS[@]} | fgrep -w $FRAMEWORK) ]]; then
@@ -123,56 +128,19 @@ if [ $NO_BUILD = false ]; then
# Only .NET 5 and above can publish to a single file # Only .NET 5 and above can publish to a single file
if [[ $(echo ${SINGLE_FILE_CAPABLE[@]} | fgrep -w $FRAMEWORK) ]]; then if [[ $(echo ${SINGLE_FILE_CAPABLE[@]} | fgrep -w $FRAMEWORK) ]]; then
# Only include Debug if set EXTRA_OPTS="-p:PublishSingleFile=true"
if [ $INCLUDE_DEBUG = true ]; then
dotnet publish ExtractionTool/ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
fi
dotnet publish ExtractionTool/ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
else
# Only include Debug if set
if [ $INCLUDE_DEBUG = true ]; then
dotnet publish ExtractionTool/ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
fi
dotnet publish ExtractionTool/ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
fi
done
done
# Build InfoPrint
for FRAMEWORK in "${FRAMEWORKS[@]}"; do
for RUNTIME in "${RUNTIMES[@]}"; do
# Output the current build
echo "===== Build InfoPrint - $FRAMEWORK, $RUNTIME ====="
# If we have an invalid combination of framework and runtime
if [[ ! $(echo ${VALID_CROSS_PLATFORM_FRAMEWORKS[@]} | fgrep -w $FRAMEWORK) ]]; then
if [[ $(echo ${VALID_CROSS_PLATFORM_RUNTIMES[@]} | fgrep -w $RUNTIME) ]]; then
echo "Skipped due to invalid combination"
continue
fi
fi fi
# If we have Apple silicon but an unsupported framework # Only include Debug if set
if [[ ! $(echo ${VALID_APPLE_FRAMEWORKS[@]} | fgrep -w $FRAMEWORK) ]]; then if [ $INCLUDE_DEBUG = true ]; then
if [ $RUNTIME = "osx-arm64" ]; then dotnet publish ExtractionTool/ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT $EXTRA_OPTS
echo "Skipped due to no Apple Silicon support" dotnet publish InfoPrint/InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT $EXTRA_OPTS
continue
fi
fi fi
# Only .NET 5 and above can publish to a single file # Only include Release if set
if [[ $(echo ${SINGLE_FILE_CAPABLE[@]} | fgrep -w $FRAMEWORK) ]]; then if [ $INCLUDE_RELEASE = true ]; then
# Only include Debug if set dotnet publish ExtractionTool/ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false $EXTRA_OPTS
if [ $INCLUDE_DEBUG = true ]; then dotnet publish InfoPrint/InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false $EXTRA_OPTS
dotnet publish InfoPrint/InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
fi
dotnet publish InfoPrint/InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
else
# Only include Debug if set
if [ $INCLUDE_DEBUG = true ]; then
dotnet publish InfoPrint/InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
fi
dotnet publish InfoPrint/InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
fi fi
done done
done done
@@ -180,11 +148,16 @@ fi
# Only create archives if requested # Only create archives if requested
if [ $NO_ARCHIVE = false ]; then if [ $NO_ARCHIVE = false ]; then
# Create ExtractionTool archives # Only include a version if one exists
if [ $HAS_VERSION = true ]; then
VERSION_STRING="_$BUILD_VERSION"
fi
# Create ExtractionTool and InfoPrint archives
for FRAMEWORK in "${FRAMEWORKS[@]}"; do for FRAMEWORK in "${FRAMEWORKS[@]}"; do
for RUNTIME in "${RUNTIMES[@]}"; do for RUNTIME in "${RUNTIMES[@]}"; do
# Output the current build # Output the current build
echo "===== Archive ExtractionTool - $FRAMEWORK, $RUNTIME =====" echo "===== Archive ExtractionTool and InfoPrint - $FRAMEWORK, $RUNTIME ====="
# If we have an invalid combination of framework and runtime # If we have an invalid combination of framework and runtime
if [[ ! $(echo ${VALID_CROSS_PLATFORM_FRAMEWORKS[@]} | fgrep -w $FRAMEWORK) ]]; then if [[ ! $(echo ${VALID_CROSS_PLATFORM_FRAMEWORKS[@]} | fgrep -w $FRAMEWORK) ]]; then
@@ -205,57 +178,19 @@ if [ $NO_ARCHIVE = false ]; then
# Only include Debug if set # Only include Debug if set
if [ $INCLUDE_DEBUG = true ]; then if [ $INCLUDE_DEBUG = true ]; then
cd $BUILD_FOLDER/ExtractionTool/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/ cd $BUILD_FOLDER/ExtractionTool/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/
if [ $HAS_VERSION = true ]; then zip -r $BUILD_FOLDER/ExtractionTool${VERSION_STRING}_${FRAMEWORK}_${RUNTIME}_debug.zip .
zip -r $BUILD_FOLDER/ExtractionTool_${VERSION}_${FRAMEWORK}_${RUNTIME}_debug.zip .
else
zip -r $BUILD_FOLDER/ExtractionTool_${FRAMEWORK}_${RUNTIME}_debug.zip .
fi
fi
cd $BUILD_FOLDER/ExtractionTool/bin/Release/${FRAMEWORK}/${RUNTIME}/publish/
if [ $HAS_VERSION = true ]; then
zip -r $BUILD_FOLDER/ExtractionTool_${VERSION}_${FRAMEWORK}_${RUNTIME}_release.zip .
else
zip -r $BUILD_FOLDER/ExtractionTool_${FRAMEWORK}_${RUNTIME}_release.zip .
fi
done
done
# Create InfoPrint archives
for FRAMEWORK in "${FRAMEWORKS[@]}"; do
for RUNTIME in "${RUNTIMES[@]}"; do
# Output the current build
echo "===== Archive InfoPrint - $FRAMEWORK, $RUNTIME ====="
# If we have an invalid combination of framework and runtime
if [[ ! $(echo ${VALID_CROSS_PLATFORM_FRAMEWORKS[@]} | fgrep -w $FRAMEWORK) ]]; then
if [[ $(echo ${VALID_CROSS_PLATFORM_RUNTIMES[@]} | fgrep -w $RUNTIME) ]]; then
echo "Skipped due to invalid combination"
continue
fi
fi
# If we have Apple silicon but an unsupported framework
if [[ ! $(echo ${VALID_APPLE_FRAMEWORKS[@]} | fgrep -w $FRAMEWORK) ]]; then
if [ $RUNTIME = "osx-arm64" ]; then
echo "Skipped due to no Apple Silicon support"
continue
fi
fi
# Only include Debug if set
if [ $INCLUDE_DEBUG = true ]; then
cd $BUILD_FOLDER/InfoPrint/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/ cd $BUILD_FOLDER/InfoPrint/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/
if [ $HAS_VERSION = true ]; then zip -r $BUILD_FOLDER/InfoPrint${VERSION_STRING}_${FRAMEWORK}_${RUNTIME}_debug.zip .
zip -r $BUILD_FOLDER/InfoPrint_${VERSION}_${FRAMEWORK}_${RUNTIME}_debug.zip .
else
zip -r $BUILD_FOLDER/InfoPrint_${FRAMEWORK}_${RUNTIME}_debug.zip .
fi
fi fi
cd $BUILD_FOLDER/InfoPrint/bin/Release/${FRAMEWORK}/${RUNTIME}/publish/
if [ $HAS_VERSION = true ]; then # Only include Release if set
zip -r $BUILD_FOLDER/InfoPrint_${VERSION}_${FRAMEWORK}_${RUNTIME}_release.zip . if [ $INCLUDE_RELEASE = true ]; then
else cd $BUILD_FOLDER/ExtractionTool/bin/Release/${FRAMEWORK}/${RUNTIME}/publish/
zip -r $BUILD_FOLDER/InfoPrint_${FRAMEWORK}_${RUNTIME}_release.zip . zip -r $BUILD_FOLDER/ExtractionTool${VERSION_STRING}_${FRAMEWORK}_${RUNTIME}_release.zip .
cd $BUILD_FOLDER/InfoPrint/bin/Release/${FRAMEWORK}/${RUNTIME}/publish/
zip -r $BUILD_FOLDER/InfoPrint${VERSION_STRING}_${FRAMEWORK}_${RUNTIME}_release.zip .
fi fi
done done
done done

View File

@@ -16,6 +16,10 @@ param(
[Alias("IncludeDebug")] [Alias("IncludeDebug")]
[switch]$INCLUDE_DEBUG, [switch]$INCLUDE_DEBUG,
[Parameter(Mandatory = $false)]
[Alias("IncludeRelease")]
[switch]$INCLUDE_RELEASE,
[Parameter(Mandatory = $false)] [Parameter(Mandatory = $false)]
[Alias("IncludeUnpublished")] [Alias("IncludeUnpublished")]
[switch]$INCLUDE_UNPUBLISHED, [switch]$INCLUDE_UNPUBLISHED,
@@ -43,10 +47,11 @@ $COMMIT = git log --pretty=format:"%H" -1
Write-Host "Selected Options:" Write-Host "Selected Options:"
Write-Host " Use all frameworks (-UseAll) $USE_ALL" Write-Host " Use all frameworks (-UseAll) $USE_ALL"
Write-Host " Include debug builds (-IncludeDebug) $INCLUDE_DEBUG" Write-Host " Include debug builds (-IncludeDebug) $INCLUDE_DEBUG"
Write-Host " Include unpublished packages (-IncludeUnpublished) $INCLUDE_DEBUG" Write-Host " Include release builds (-IncludeRelease) $INCLUDE_RELEASE"
Write-Host " Include unpublished packages (-IncludeUnpublished) $INCLUDE_UNPUBLISHED"
Write-Host " No build (-NoBuild) $NO_BUILD" Write-Host " No build (-NoBuild) $NO_BUILD"
Write-Host " No archive (-NoArchive) $NO_ARCHIVE" Write-Host " No archive (-NoArchive) $NO_ARCHIVE"
Write-Host " Version (-BuildVersion) $BUILD_VERSION" Write-Host " Version (-BuildVersion) $BUILD_VERSION"
Write-Host " " Write-Host " "
# Create the build matrix arrays # Create the build matrix arrays
@@ -88,11 +93,11 @@ if (!$NO_BUILD.IsPresent) {
dotnet pack SabreTools.Wrappers\SabreTools.Wrappers.csproj --output $BUILD_FOLDER dotnet pack SabreTools.Wrappers\SabreTools.Wrappers.csproj --output $BUILD_FOLDER
} }
# Build ExtractionTool # Build ExtractionTool and InfoPrint
foreach ($FRAMEWORK in $FRAMEWORKS) { foreach ($FRAMEWORK in $FRAMEWORKS) {
foreach ($RUNTIME in $RUNTIMES) { foreach ($RUNTIME in $RUNTIMES) {
# Output the current build # Output the current build
Write-Host "===== Build ExtractionTool - $FRAMEWORK, $RUNTIME =====" Write-Host "===== Build ExtractionTool and InfoPrint - $FRAMEWORK, $RUNTIME ====="
# If we have an invalid combination of framework and runtime # If we have an invalid combination of framework and runtime
if ($VALID_CROSS_PLATFORM_FRAMEWORKS -notcontains $FRAMEWORK -and $VALID_CROSS_PLATFORM_RUNTIMES -contains $RUNTIME) { if ($VALID_CROSS_PLATFORM_FRAMEWORKS -notcontains $FRAMEWORK -and $VALID_CROSS_PLATFORM_RUNTIMES -contains $RUNTIME) {
@@ -108,54 +113,19 @@ if (!$NO_BUILD.IsPresent) {
# Only .NET 5 and above can publish to a single file # Only .NET 5 and above can publish to a single file
if ($SINGLE_FILE_CAPABLE -contains $FRAMEWORK) { if ($SINGLE_FILE_CAPABLE -contains $FRAMEWORK) {
# Only include Debug if set $EXTRA_OPTS = "-p:PublishSingleFile=true"
if ($INCLUDE_DEBUG.IsPresent) {
dotnet publish ExtractionTool\ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
}
dotnet publish ExtractionTool\ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
}
else {
# Only include Debug if set
if ($INCLUDE_DEBUG.IsPresent) {
dotnet publish ExtractionTool\ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
}
dotnet publish ExtractionTool\ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
}
}
}
# Build InfoPrint
foreach ($FRAMEWORK in $FRAMEWORKS) {
foreach ($RUNTIME in $RUNTIMES) {
# Output the current build
Write-Host "===== Build InfoPrint - $FRAMEWORK, $RUNTIME ====="
# If we have an invalid combination of framework and runtime
if ($VALID_CROSS_PLATFORM_FRAMEWORKS -notcontains $FRAMEWORK -and $VALID_CROSS_PLATFORM_RUNTIMES -contains $RUNTIME) {
Write-Host "Skipped due to invalid combination"
continue
} }
# If we have Apple silicon but an unsupported framework # Only include Debug if set
if ($VALID_APPLE_FRAMEWORKS -notcontains $FRAMEWORK -and $RUNTIME -eq 'osx-arm64') { if ($INCLUDE_DEBUG.IsPresent) {
Write-Host "Skipped due to no Apple Silicon support" dotnet publish ExtractionTool\ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT $EXTRA_OPTS
continue dotnet publish InfoPrint\InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT $EXTRA_OPTS
} }
# Only .NET 5 and above can publish to a single file # Only include Release if set
if ($SINGLE_FILE_CAPABLE -contains $FRAMEWORK) { if ($INCLUDE_RELEASE.IsPresent) {
# Only include Debug if set dotnet publish ExtractionTool\ExtractionTool.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false $EXTRA_OPTS
if ($INCLUDE_DEBUG.IsPresent) { dotnet publish InfoPrint\InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false $EXTRA_OPTS
dotnet publish InfoPrint\InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true
}
dotnet publish InfoPrint\InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false
}
else {
# Only include Debug if set
if ($INCLUDE_DEBUG.IsPresent) {
dotnet publish InfoPrint\InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Debug --self-contained true --version-suffix $COMMIT
}
dotnet publish InfoPrint\InfoPrint.csproj -f $FRAMEWORK -r $RUNTIME -c Release --self-contained true --version-suffix $COMMIT -p:DebugType=None -p:DebugSymbols=false
} }
} }
} }
@@ -163,11 +133,16 @@ if (!$NO_BUILD.IsPresent) {
# Only create archives if requested # Only create archives if requested
if (!$NO_ARCHIVE.IsPresent) { if (!$NO_ARCHIVE.IsPresent) {
# Create ExtractionTool archives # Only include a version if one exists
if ($BUILD_VERSION -ne $null) {
$VERSION_STRING = "_$BUILD_VERSION"
}
# Create ExtractionTool and InfoPrint archives
foreach ($FRAMEWORK in $FRAMEWORKS) { foreach ($FRAMEWORK in $FRAMEWORKS) {
foreach ($RUNTIME in $RUNTIMES) { foreach ($RUNTIME in $RUNTIMES) {
# Output the current build # Output the current build
Write-Host "===== Archive ExtractionTool - $FRAMEWORK, $RUNTIME =====" Write-Host "===== Archive ExtractionTool and InfoPrint - $FRAMEWORK, $RUNTIME ====="
# If we have an invalid combination of framework and runtime # If we have an invalid combination of framework and runtime
if ($VALID_CROSS_PLATFORM_FRAMEWORKS -notcontains $FRAMEWORK -and $VALID_CROSS_PLATFORM_RUNTIMES -contains $RUNTIME) { if ($VALID_CROSS_PLATFORM_FRAMEWORKS -notcontains $FRAMEWORK -and $VALID_CROSS_PLATFORM_RUNTIMES -contains $RUNTIME) {
@@ -184,59 +159,19 @@ if (!$NO_ARCHIVE.IsPresent) {
# Only include Debug if set # Only include Debug if set
if ($INCLUDE_DEBUG.IsPresent) { if ($INCLUDE_DEBUG.IsPresent) {
Set-Location -Path $BUILD_FOLDER\ExtractionTool\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\ Set-Location -Path $BUILD_FOLDER\ExtractionTool\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\
if ($BUILD_VERSION -ne $null) { 7z a -tzip $BUILD_FOLDER\ExtractionTool${VERSION_STRING}_${FRAMEWORK}_${RUNTIME}_debug.zip *
7z a -tzip $BUILD_FOLDER\ExtractionTool_${BUILD_VERSION}_${FRAMEWORK}_${RUNTIME}_debug.zip *
}
else {
7z a -tzip $BUILD_FOLDER\ExtractionTool_${FRAMEWORK}_${RUNTIME}_debug.zip *
}
}
Set-Location -Path $BUILD_FOLDER\ExtractionTool\bin\Release\${FRAMEWORK}\${RUNTIME}\publish\
if ($BUILD_VERSION -ne $null) {
7z a -tzip $BUILD_FOLDER\ExtractionTool_${BUILD_VERSION}_${FRAMEWORK}_${RUNTIME}_release.zip *
}
else {
7z a -tzip $BUILD_FOLDER\ExtractionTool_${FRAMEWORK}_${RUNTIME}_release.zip *
}
}
}
# Create InfoPrint archives
foreach ($FRAMEWORK in $FRAMEWORKS) {
foreach ($RUNTIME in $RUNTIMES) {
# Output the current build
Write-Host "===== Archive InfoPrint - $FRAMEWORK, $RUNTIME ====="
# If we have an invalid combination of framework and runtime
if ($VALID_CROSS_PLATFORM_FRAMEWORKS -notcontains $FRAMEWORK -and $VALID_CROSS_PLATFORM_RUNTIMES -contains $RUNTIME) {
Write-Host "Skipped due to invalid combination"
continue
}
# If we have Apple silicon but an unsupported framework
if ($VALID_APPLE_FRAMEWORKS -notcontains $FRAMEWORK -and $RUNTIME -eq 'osx-arm64') {
Write-Host "Skipped due to no Apple Silicon support"
continue
}
# Only include Debug if set
if ($INCLUDE_DEBUG.IsPresent) {
Set-Location -Path $BUILD_FOLDER\InfoPrint\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\ Set-Location -Path $BUILD_FOLDER\InfoPrint\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\
if ($BUILD_VERSION -ne $null) { 7z a -tzip $BUILD_FOLDER\InfoPrint${VERSION_STRING}_${FRAMEWORK}_${RUNTIME}_debug.zip *
7z a -tzip $BUILD_FOLDER\InfoPrint_${BUILD_VERSION}_${FRAMEWORK}_${RUNTIME}_debug.zip *
}
else {
7z a -tzip $BUILD_FOLDER\InfoPrint_${FRAMEWORK}_${RUNTIME}_debug.zip *
}
} }
Set-Location -Path $BUILD_FOLDER\InfoPrint\bin\Release\${FRAMEWORK}\${RUNTIME}\publish\ # Only include Release if set
if ($BUILD_VERSION -ne $null) { if ($INCLUDE_RELEASE.IsPresent) {
7z a -tzip $BUILD_FOLDER\InfoPrint_${BUILD_VERSION}_${FRAMEWORK}_${RUNTIME}_release.zip * Set-Location -Path $BUILD_FOLDER\ExtractionTool\bin\Release\${FRAMEWORK}\${RUNTIME}\publish\
} 7z a -tzip $BUILD_FOLDER\ExtractionTool${VERSION_STRING}_${FRAMEWORK}_${RUNTIME}_release.zip *
else {
7z a -tzip $BUILD_FOLDER\InfoPrint_${FRAMEWORK}_${RUNTIME}_release.zip * Set-Location -Path $BUILD_FOLDER\InfoPrint\bin\Release\${FRAMEWORK}\${RUNTIME}\publish\
7z a -tzip $BUILD_FOLDER\InfoPrint${VERSION_STRING}_${FRAMEWORK}_${RUNTIME}_release.zip *
} }
} }
} }