From 9c6a3058d4b380a38e0b97f0134c65a588727ed1 Mon Sep 17 00:00:00 2001 From: BDisp Date: Fri, 11 Oct 2024 02:31:55 +0100 Subject: [PATCH] Fixes #3784. SelfContained and NativeAot projects should use the local package in the release mode. (#3785) * Fixes #3784. SelfContained and NativeAot projects should use the local package in the release mode. * Run dotnet restore before build. * Using local_packages folder for CI. * Add build_release_consumer. * Remove build_release_consumer. * Fix folder for CI. * Fix System.Text.Json vulnerability. * Fix local_packageslocation. * Add package sources to the packageSourceMapping tag. * Using the original configuration. * Only add the Terminal.Gui pattern in the LocalPackages. * Fix the path folder separator with unit style. * Using pack instead of build. * Create LocalPackages Directory * Add local_packages source. * Using scripts to build release for NativeAot and SelfContained. * Trying to fix path. * Again. * Fix the path for the package, * Need to build before pack. * Needs also build before pack locally. * Fix build path. --- .github/workflows/dotnet-core.yml | 8 +++++++- .gitignore | 1 + NativeAot/NativeAot.csproj | 2 +- NativeAot/PackTerminalGui.ps1 | 9 +++++++++ NativeAot/PackTerminalGui.sh | 11 +++++++++++ SelfContained/PackTerminalGui.ps1 | 9 +++++++++ SelfContained/PackTerminalGui.sh | 11 +++++++++++ SelfContained/SelfContained.csproj | 2 +- Terminal.Gui/Terminal.Gui.csproj | 2 +- nuget.config | 4 ++++ 10 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 NativeAot/PackTerminalGui.ps1 create mode 100644 NativeAot/PackTerminalGui.sh create mode 100644 SelfContained/PackTerminalGui.ps1 create mode 100644 SelfContained/PackTerminalGui.sh diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 5779ed9da..d22eefcfb 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -90,7 +90,13 @@ jobs: dotnet-version: 8.x dotnet-quality: 'ga' - - name: Build Release + - name: Build Release Terminal.Gui + run: dotnet build Terminal.Gui/Terminal.Gui.csproj --configuration Release + + - name: Pack Release Terminal.Gui + run: dotnet pack Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ./local_packages + + - name: Build Release Solution run: dotnet build --configuration Release diff --git a/.gitignore b/.gitignore index cca1f4801..1a111a2ca 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,4 @@ demo.* *.tui/ *.dotCover +/local_packages/ diff --git a/NativeAot/NativeAot.csproj b/NativeAot/NativeAot.csproj index 20721a952..4f5238a9d 100644 --- a/NativeAot/NativeAot.csproj +++ b/NativeAot/NativeAot.csproj @@ -15,7 +15,7 @@ - + diff --git a/NativeAot/PackTerminalGui.ps1 b/NativeAot/PackTerminalGui.ps1 new file mode 100644 index 000000000..ea6bff054 --- /dev/null +++ b/NativeAot/PackTerminalGui.ps1 @@ -0,0 +1,9 @@ +# Step 1: Build and pack Terminal.Gui +dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release +dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages + +# Step 2: Restore NativeAot with the new package +dotnet restore ./NativeAot.csproj --source ./local_packages + +# Step 3: Build NativeAot +dotnet build ./NativeAot.csproj --configuration Release diff --git a/NativeAot/PackTerminalGui.sh b/NativeAot/PackTerminalGui.sh new file mode 100644 index 000000000..ab0cc7e17 --- /dev/null +++ b/NativeAot/PackTerminalGui.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Step 1: Build and pack Terminal.Gui +dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release +dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages + +# Step 2: Restore NativeAot with the new package +dotnet restore ./NativeAot.csproj --source ./local_packages + +# Step 3: Build NativeAot +dotnet build ./NativeAot.csproj --configuration Release diff --git a/SelfContained/PackTerminalGui.ps1 b/SelfContained/PackTerminalGui.ps1 new file mode 100644 index 000000000..6e5cd4192 --- /dev/null +++ b/SelfContained/PackTerminalGui.ps1 @@ -0,0 +1,9 @@ +# Step 1: Build and pack Terminal.Gui +dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release +dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages + +# Step 2: Restore SelfContained with the new package +dotnet restore ./SelfContained.csproj --source ./local_packages + +# Step 3: Build SelfContained +dotnet build ./SelfContained.csproj --configuration Release diff --git a/SelfContained/PackTerminalGui.sh b/SelfContained/PackTerminalGui.sh new file mode 100644 index 000000000..d2cba3e87 --- /dev/null +++ b/SelfContained/PackTerminalGui.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Step 1: Build and pack Terminal.Gui +dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release +dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages + +# Step 2: Restore SelfContained with the new package +dotnet restore ./SelfContained.csproj --source ./local_packages + +# Step 3: Build SelfContained +dotnet build ./SelfContained.csproj --configuration Release diff --git a/SelfContained/SelfContained.csproj b/SelfContained/SelfContained.csproj index af651e3ca..46800e09c 100644 --- a/SelfContained/SelfContained.csproj +++ b/SelfContained/SelfContained.csproj @@ -18,7 +18,7 @@ - + diff --git a/Terminal.Gui/Terminal.Gui.csproj b/Terminal.Gui/Terminal.Gui.csproj index 3a4dcc680..b11044a16 100644 --- a/Terminal.Gui/Terminal.Gui.csproj +++ b/Terminal.Gui/Terminal.Gui.csproj @@ -60,7 +60,7 @@ - + diff --git a/nuget.config b/nuget.config index 808d98ba0..c5478a199 100644 --- a/nuget.config +++ b/nuget.config @@ -9,10 +9,14 @@ + + + +