@@ -17,6 +17,8 @@ namespace Chisel.Tests;
1717
1818public sealed class TestApp : IAsyncLifetime
1919{
20+ private static readonly bool IsContinuousIntegrationBuild = Environment . GetEnvironmentVariable ( "ContinuousIntegrationBuild" ) == "true" ;
21+
2022 private readonly DirectoryInfo _workingDirectory ;
2123 private readonly Dictionary < PublishMode , FileInfo > _executables ;
2224 private string _packageVersion = "N/A" ;
@@ -40,7 +42,7 @@ async ValueTask IAsyncLifetime.InitializeAsync()
4042
4143 ValueTask IAsyncDisposable . DisposeAsync ( )
4244 {
43- if ( Environment . GetEnvironmentVariable ( "ContinuousIntegrationBuild" ) == "true" )
45+ if ( IsContinuousIntegrationBuild )
4446 {
4547 // The NuGet package was already built as part of the tests (PackAsync),
4648 // so move it to the root of the repository for the "Upload NuGet package artifact" step to pick it.
@@ -83,13 +85,18 @@ private async Task CreateTestAppAsync()
8385 private async Task PackAsync ( )
8486 {
8587 var projectFile = GetFile ( "src" , "Chisel" , "Chisel.csproj" ) ;
86- var packArgs = new [ ] {
88+ var packArgs = new List < string > {
8789 "pack" , projectFile . FullName ,
8890 "--no-build" ,
8991 "--output" , _workingDirectory . FullName ,
9092 "--getProperty:PackageVersion" ,
9193 } ;
92- var packageVersion = await RunDotnetAsync ( _workingDirectory , packArgs ) ;
94+ if ( IsContinuousIntegrationBuild )
95+ {
96+ packArgs . Add ( "--configuration" ) ;
97+ packArgs . Add ( "Release" ) ;
98+ }
99+ var packageVersion = await RunDotnetAsync ( _workingDirectory , packArgs . ToArray ( ) ) ;
93100 _packageVersion = packageVersion . TrimEnd ( ) ;
94101 }
95102
0 commit comments