From e8a15fbe3f695444d2e8cc711d6f03500af6fdc6 Mon Sep 17 00:00:00 2001 From: Mingbo Peng Date: Fri, 12 Sep 2025 23:35:30 -0400 Subject: [PATCH] fix(net8): build net8 with net48 --- .github/workflows/release.yaml | 20 ++---------- .gitignore | 2 ++ Makefile | 31 +++++++++++++++++++ src/Ironbug.Console/Ironbug.Console.csproj | 4 +-- .../Ironbug.Grasshopper.csproj | 13 ++++++-- 5 files changed, 49 insertions(+), 21 deletions(-) create mode 100644 Makefile diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 29e120cf..0e979d5b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -48,22 +48,11 @@ jobs: - name: MSBuild GH Plugin run: | echo ${{ env.ReleaseVersion }} - msbuild src/Ironbug.Grasshopper/Ironbug.Grasshopper.csproj /p:Configuration=Release /p:Platform=x64 /p:Version=${{ env.ReleaseVersion }} /restore - mkdir installer/plugin - - mv src/Ironbug.Grasshopper/bin/x64/Release/* installer/plugin - mkdir installer/HVACTemplates - cp doc/HVAC_GHTemplates/* installer/HVACTemplates -r - - ls installer -r + make build-Grasshopper NEW_RELEASE_VERSION=${{ env.ReleaseVersion }} - name: Build Ironbug.Console run: | - dotnet build ./src/Ironbug.Console/Ironbug.Console.csproj /p:Configuration=Release /p:Platform=x64 /p:TargetFramework=NET48 /p:Version=${{ env.ReleaseVersion }} - ls ./src/Ironbug.Console/bin/x64/Release/ - 7z a -tzip ironbug.console.win.zip ./src/Ironbug.Console/bin/x64/Release/ - - cp ./src/Ironbug.Console/bin/x64/Release/Ironbug.Console.exe installer/plugin + make build-console-win NEW_RELEASE_VERSION=${{ env.ReleaseVersion }} - name: Unit tests run: | @@ -157,10 +146,7 @@ jobs: - name: Build run: | - dotnet build ./src/Ironbug.Console/Ironbug.Console.csproj -a x64 /p:Configuration=Release /p:TargetFramework=NET8 /p:Version=${{ env.ReleaseVersion }} - - ls ./src/Ironbug.Console/bin/Release/linux-x64 - zip -r ironbug.console.linux.zip ./src/Ironbug.Console/bin/Release/linux-x64 + make build-console-linux NEW_RELEASE_VERSION=${{ env.ReleaseVersion }} - name: Console test run: | diff --git a/.gitignore b/.gitignore index 25a8054f..4c4704e3 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,8 @@ installer/HVACTemplates/* bld/ [Bb]in/ [Oo]bj/ +installer/plugin/ +installer/HVACTemplates/ # Visual Studio 2015 cache/options directory .vs/ diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..6284d151 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +NEW_RELEASE_VERSION ?= 0.0.1 + + +build-Grasshopper: + dotnet build ./src/Ironbug.Grasshopper/Ironbug.Grasshopper.csproj /p:Configuration=Release /p:Platform=x64 /p:Version=$(NEW_RELEASE_VERSION) /restore + mkdir -p installer/plugin + mv src/Ironbug.Grasshopper/bin/x64/Release/net8-windows/* installer/plugin/ + mv src/Ironbug.Grasshopper/bin/x64/Release/net48/* installer/plugin/net48/ + mkdir -p installer/HVACTemplates + cp doc/HVAC_GHTemplates/* installer/HVACTemplates -r + + ls installer -r + +build-console-win: + dotnet build ./src/Ironbug.Console/Ironbug.Console.csproj /p:Configuration=Release /p:Platform=x64 /p:Version=$(NEW_RELEASE_VERSION) /restore + ls ./src/Ironbug.Console/bin/x64/Release/ + 7z a -tzip ironbug.console.win.zip ./src/Ironbug.Console/bin/x64/Release + rm ./src/Ironbug.Console/bin/x64/Release/net48/openstudio* -r + rm ./src/Ironbug.Console/bin/x64/Release/net8/openstudio* -r + + cp ./src/Ironbug.Console/bin/x64/Release/net8/* installer/plugin + cp ./src/Ironbug.Console/bin/x64/Release/net48/* installer/plugin/net48/ + + 7z a -tzip installer/plugin/net48.zip ./installer/plugin/net48/* + rm -r installer/plugin/net48 + +build-console-linux: + dotnet build ./src/Ironbug.Console/Ironbug.Console.csproj -a x64 /p:Configuration=Release /p:TargetFramework=net8 /p:Version=$(NEW_RELEASE_VERSION) + ls ./src/Ironbug.Console/bin/Release/linux-x64/net8 + zip -r ironbug.console.linux.zip ./src/Ironbug.Console/bin/Release/linux-x64/net8 + diff --git a/src/Ironbug.Console/Ironbug.Console.csproj b/src/Ironbug.Console/Ironbug.Console.csproj index 3ed7a98c..22f4b2cf 100644 --- a/src/Ironbug.Console/Ironbug.Console.csproj +++ b/src/Ironbug.Console/Ironbug.Console.csproj @@ -2,8 +2,8 @@ Exe - NET48;NET8 - false + net48;net8 + true x64 9.99.0 diff --git a/src/Ironbug.Grasshopper/Ironbug.Grasshopper.csproj b/src/Ironbug.Grasshopper/Ironbug.Grasshopper.csproj index 20f07a87..89791746 100644 --- a/src/Ironbug.Grasshopper/Ironbug.Grasshopper.csproj +++ b/src/Ironbug.Grasshopper/Ironbug.Grasshopper.csproj @@ -1,11 +1,14 @@  - NET48 + net48;net8-windows x64 .gha - false + true 1.0.1 + true + true + @@ -18,6 +21,12 @@ + + + + + +