Skip to content

Commit 9c6a305

Browse files
authored
Fixes gui-cs#3784. SelfContained and NativeAot projects should use the local package in the release mode. (gui-cs#3785)
* Fixes gui-cs#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.
1 parent f789f6a commit 9c6a305

10 files changed

+55
-4
lines changed

.github/workflows/dotnet-core.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ jobs:
9090
dotnet-version: 8.x
9191
dotnet-quality: 'ga'
9292

93-
- name: Build Release
93+
- name: Build Release Terminal.Gui
94+
run: dotnet build Terminal.Gui/Terminal.Gui.csproj --configuration Release
95+
96+
- name: Pack Release Terminal.Gui
97+
run: dotnet pack Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ./local_packages
98+
99+
- name: Build Release Solution
94100
run: dotnet build --configuration Release
95101

96102

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ demo.*
6161
*.tui/
6262

6363
*.dotCover
64+
/local_packages/

NativeAot/NativeAot.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</ItemGroup>
1616

1717
<ItemGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
18-
<PackageReference Include="Terminal.Gui" Version="[2.0.0-v2-develop.2189,3)" />
18+
<PackageReference Include="Terminal.Gui" Version="2.0.0" />
1919
<TrimmerRootAssembly Include="Terminal.Gui" />
2020
</ItemGroup>
2121

NativeAot/PackTerminalGui.ps1

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Step 1: Build and pack Terminal.Gui
2+
dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release
3+
dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages
4+
5+
# Step 2: Restore NativeAot with the new package
6+
dotnet restore ./NativeAot.csproj --source ./local_packages
7+
8+
# Step 3: Build NativeAot
9+
dotnet build ./NativeAot.csproj --configuration Release

NativeAot/PackTerminalGui.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# Step 1: Build and pack Terminal.Gui
4+
dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release
5+
dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages
6+
7+
# Step 2: Restore NativeAot with the new package
8+
dotnet restore ./NativeAot.csproj --source ./local_packages
9+
10+
# Step 3: Build NativeAot
11+
dotnet build ./NativeAot.csproj --configuration Release

SelfContained/PackTerminalGui.ps1

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Step 1: Build and pack Terminal.Gui
2+
dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release
3+
dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages
4+
5+
# Step 2: Restore SelfContained with the new package
6+
dotnet restore ./SelfContained.csproj --source ./local_packages
7+
8+
# Step 3: Build SelfContained
9+
dotnet build ./SelfContained.csproj --configuration Release

SelfContained/PackTerminalGui.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# Step 1: Build and pack Terminal.Gui
4+
dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release
5+
dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages
6+
7+
# Step 2: Restore SelfContained with the new package
8+
dotnet restore ./SelfContained.csproj --source ./local_packages
9+
10+
# Step 3: Build SelfContained
11+
dotnet build ./SelfContained.csproj --configuration Release

SelfContained/SelfContained.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</ItemGroup>
1919

2020
<ItemGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
21-
<PackageReference Include="Terminal.Gui" Version="[2.0.0-pre.1788,3)" />
21+
<PackageReference Include="Terminal.Gui" Version="2.0.0" />
2222
<TrimmerRootAssembly Include="Terminal.Gui" />
2323
</ItemGroup>
2424

Terminal.Gui/Terminal.Gui.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<!-- Enable Nuget Source Link for github -->
6161
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="[8,9)" PrivateAssets="all" />
6262
<PackageReference Include="System.IO.Abstractions" Version="[21.0.22,22)" />
63-
<PackageReference Include="System.Text.Json" Version="[8.0.4,9)" />
63+
<PackageReference Include="System.Text.Json" Version="[8.0.5,9)" />
6464
<PackageReference Include="Wcwidth" Version="[2,3)" />
6565
</ItemGroup>
6666
<!-- =================================================================== -->

nuget.config

+4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@
99
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
1010
<clear />
1111
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
12+
<add key="LocalPackages" value="./local_packages" />
1213
</packageSources>
1314
<packageSourceMapping>
1415
<packageSource key="nuget">
1516
<package pattern="*" />
1617
</packageSource>
18+
<packageSource key="LocalPackages">
19+
<package pattern="Terminal.Gui*" />
20+
</packageSource>
1721
</packageSourceMapping>
1822
</configuration>

0 commit comments

Comments
 (0)