From 3aae2990a32d9fec98812708d3683c2d9e79f39b Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 20 Jun 2024 13:56:28 -0400 Subject: [PATCH] Better support build matricies --- .github/workflows/build_check.yml | 2 +- CHANGELIST.md | 1 + MPF.Check/MPF.Check.csproj | 15 ++++- .../MPF.ExecutionContexts.csproj | 15 ++++- MPF.Frontend/MPF.Frontend.csproj | 15 ++++- MPF.Processors/MPF.Processors.csproj | 19 +++++- publish-nix.sh | 62 ++++++++++++++++++- publish-win.ps1 | 52 +++++++++++++++- 8 files changed, 170 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index fe85025f..306f39d5 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: project: [MPF.Check] - runtime: [win-x86, win-x64, linux-x64, linux-arm64, osx-x64] #[win-x86, win-x64, win-arm64, linux-x64, linux-arm64, osx-x64] + runtime: [win-x86, win-x64, linux-x64, linux-arm64, osx-x64, osx-arm64] #[win-x86, win-x64, win-arm64, linux-x64, linux-arm64, osx-x64, osx-arm64] framework: [net8.0] #[net20, net35, net40, net452, net472, net48, netcoreapp3.1, net5.0, net6.0, net7.0, net8.0] steps: diff --git a/CHANGELIST.md b/CHANGELIST.md index c0429487..42fc8901 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -6,6 +6,7 @@ - Fix nuget package naming - Forgot to upload packages to release - Add `osx-arm64` to libraries +- Better support build matricies ### 3.2.0 (2024-06-20) diff --git a/MPF.Check/MPF.Check.csproj b/MPF.Check/MPF.Check.csproj index 187b9190..ef053c1e 100644 --- a/MPF.Check/MPF.Check.csproj +++ b/MPF.Check/MPF.Check.csproj @@ -3,7 +3,6 @@ net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 - win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 Exe false false @@ -23,6 +22,20 @@ git + + + win-x86;win-x64 + + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 + + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 + + + net6.0;net7.0;net8.0 + + diff --git a/MPF.ExecutionContexts/MPF.ExecutionContexts.csproj b/MPF.ExecutionContexts/MPF.ExecutionContexts.csproj index f602b324..45b63ffc 100644 --- a/MPF.ExecutionContexts/MPF.ExecutionContexts.csproj +++ b/MPF.ExecutionContexts/MPF.ExecutionContexts.csproj @@ -3,7 +3,6 @@ net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 - win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 false false latest @@ -26,6 +25,20 @@ + + + win-x86;win-x64 + + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 + + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 + + + net6.0;net7.0;net8.0 + + diff --git a/MPF.Frontend/MPF.Frontend.csproj b/MPF.Frontend/MPF.Frontend.csproj index f94eb636..cefd551c 100644 --- a/MPF.Frontend/MPF.Frontend.csproj +++ b/MPF.Frontend/MPF.Frontend.csproj @@ -3,7 +3,6 @@ net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 - win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 false false latest @@ -25,6 +24,20 @@ + + + win-x86;win-x64 + + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 + + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 + + + net6.0;net7.0;net8.0 + + diff --git a/MPF.Processors/MPF.Processors.csproj b/MPF.Processors/MPF.Processors.csproj index b2226dbd..36674df6 100644 --- a/MPF.Processors/MPF.Processors.csproj +++ b/MPF.Processors/MPF.Processors.csproj @@ -3,7 +3,6 @@ net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 - win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 false false latest @@ -22,6 +21,24 @@ git + + + + + + + win-x86;win-x64 + + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 + + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 + + + net6.0;net7.0;net8.0 + + diff --git a/publish-nix.sh b/publish-nix.sh index 92d77f63..be9edf84 100755 --- a/publish-nix.sh +++ b/publish-nix.sh @@ -46,20 +46,21 @@ COMMIT=$(git log --pretty=%H -1) UI_FRAMEWORKS=("net8.0-windows") UI_RUNTIMES=("win-x86" "win-x64") CHECK_FRAMEWORKS=("net8.0") -CHECK_RUNTIMES=("win-x86" "win-x64" "linux-x64" "linux-arm64" "osx-x64") +CHECK_RUNTIMES=("win-x86" "win-x64" "linux-x64" "linux-arm64" "osx-x64" "osx-arm64") # Use expanded lists, if requested if [ $USE_ALL = true ]; then UI_FRAMEWORKS=("net40" "net452" "net462" "net472" "net48" "netcoreapp3.1" "net5.0-windows" "net6.0-windows" "net7.0-windows" "net8.0-windows") UI_RUNTIMES=("win-x86" "win-x64") CHECK_FRAMEWORKS=("net20" "net35" "net40" "net452" "net462" "net472" "net48" "netcoreapp3.1" "net5.0" "net6.0" "net7.0" "net8.0") - CHECK_RUNTIMES=("win-x86" "win-x64" "win-arm64" "linux-x64" "linux-arm64" "osx-x64") + CHECK_RUNTIMES=("win-x86" "win-x64" "win-arm64" "linux-x64" "linux-arm64" "osx-x64" "osx-arm64") fi # Create the filter arrays SINGLE_FILE_CAPABLE=("net5.0" "net5.0-windows" "net6.0" "net6.0-windows" "net7.0" "net7.0-windows" "net8.0" "net8.0-windows") +VALID_APPLE_FRAMEWORKS=("net6.0" "net7.0" "net8.0") VALID_CROSS_PLATFORM_FRAMEWORKS=("netcoreapp3.1" "net5.0" "net6.0" "net7.0" "net8.0") -VALID_CROSS_PLATFORM_RUNTIMES=("win-arm64" "linux-x64" "linux-arm64" "osx-x64") +VALID_CROSS_PLATFORM_RUNTIMES=("win-arm64" "linux-x64" "linux-arm64" "osx-x64" "osx-arm64") # Only build if requested if [ $NO_BUILD = false ]; then @@ -74,9 +75,21 @@ if [ $NO_BUILD = false ]; then # Build UI for FRAMEWORK in "${UI_FRAMEWORKS[@]}"; do for RUNTIME in "${UI_RUNTIMES[@]}"; do + # Output the current build + echo "===== Build UI - $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 @@ -101,9 +114,21 @@ if [ $NO_BUILD = false ]; then # Build Check for FRAMEWORK in "${CHECK_FRAMEWORKS[@]}"; do for RUNTIME in "${CHECK_RUNTIMES[@]}"; do + # Output the current build + echo "===== Build Check - $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 @@ -131,6 +156,25 @@ if [ $NO_ARCHIVE = false ]; then # Create UI archives for FRAMEWORK in "${UI_FRAMEWORKS[@]}"; do for RUNTIME in "${UI_RUNTIMES[@]}"; do + # Output the current build + echo "===== Archive UI - $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 building all if [ $USE_ALL = true ]; then cd $BUILD_FOLDER/MPF.UI/bin/Debug/${FRAMEWORK}/${RUNTIME}/publish/ @@ -152,9 +196,21 @@ if [ $NO_ARCHIVE = false ]; then # Create Check archives for FRAMEWORK in "${CHECK_FRAMEWORKS[@]}"; do for RUNTIME in "${CHECK_RUNTIMES[@]}"; do + # Output the current build + echo "===== Archive Check - $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 diff --git a/publish-win.ps1 b/publish-win.ps1 index b69dbbcd..13902312 100644 --- a/publish-win.ps1 +++ b/publish-win.ps1 @@ -37,20 +37,21 @@ $COMMIT = git log --pretty=format:"%H" -1 $UI_FRAMEWORKS = @('net8.0-windows') $UI_RUNTIMES = @('win-x86', 'win-x64') $CHECK_FRAMEWORKS = @('net8.0') -$CHECK_RUNTIMES = @('win-x86', 'win-x64', 'linux-x64', 'linux-arm64', 'osx-x64') +$CHECK_RUNTIMES = @('win-x86', 'win-x64', 'linux-x64', 'linux-arm64', 'osx-x64', 'osx-arm64') # Use expanded lists, if requested if ($USE_ALL.IsPresent) { $UI_FRAMEWORKS = @('net40', 'net452', 'net462', 'net472', 'net48', 'netcoreapp3.1', 'net5.0-windows', 'net6.0-windows', 'net7.0-windows', 'net8.0-windows') $UI_RUNTIMES = @('win-x86', 'win-x64') $CHECK_FRAMEWORKS = @('net20', 'net35', 'net40', 'net452', 'net462', 'net472', 'net48', 'netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0') - $CHECK_RUNTIMES = @('win-x86', 'win-x64', 'win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64') + $CHECK_RUNTIMES = @('win-x86', 'win-x64', 'win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64', 'osx-arm64') } # Create the filter arrays $SINGLE_FILE_CAPABLE = @('net5.0', 'net5.0-windows', 'net6.0', 'net6.0-windows', 'net7.0', 'net7.0-windows', 'net8.0', 'net8.0-windows') +$VALID_APPLE_FRAMEWORKS = @('net6.0', 'net7.0', 'net8.0') $VALID_CROSS_PLATFORM_FRAMEWORKS = @('netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0') -$VALID_CROSS_PLATFORM_RUNTIMES = @('win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64') +$VALID_CROSS_PLATFORM_RUNTIMES = @('win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64', 'osx-arm64') # Only build if requested if (!$NO_BUILD.IsPresent) { @@ -65,8 +66,18 @@ if (!$NO_BUILD.IsPresent) { # Build UI foreach ($FRAMEWORK in $UI_FRAMEWORKS) { foreach ($RUNTIME in $UI_RUNTIMES) { + # Output the current build + Write-Host "===== Build UI - $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 } @@ -91,8 +102,18 @@ if (!$NO_BUILD.IsPresent) { # Build Check foreach ($FRAMEWORK in $CHECK_FRAMEWORKS) { foreach ($RUNTIME in $CHECK_RUNTIMES) { + # Output the current build + Write-Host "===== Build Check - $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 } @@ -120,6 +141,21 @@ if (!$NO_ARCHIVE.IsPresent) { # Create UI archives foreach ($FRAMEWORK in $UI_FRAMEWORKS) { foreach ($RUNTIME in $UI_RUNTIMES) { + # Output the current build + Write-Host "===== Archive UI - $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 building all if ($USE_ALL.IsPresent) { Set-Location -Path $BUILD_FOLDER\MPF.UI\bin\Debug\${FRAMEWORK}\${RUNTIME}\publish\ @@ -144,8 +180,18 @@ if (!$NO_ARCHIVE.IsPresent) { # Create Check archives foreach ($FRAMEWORK in $CHECK_FRAMEWORKS) { foreach ($RUNTIME in $CHECK_RUNTIMES) { + # Output the current build + Write-Host "===== Archive Check - $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 }