@@ -67,6 +67,7 @@ partial class Build : NukeBuild
6767 [ Parameter ] readonly string ? TargetRuntime ;
6868
6969 const string CiBranchNameEnvVariable = "OCTOVERSION_CurrentBranch" ;
70+
7071 [ Parameter ( $ "The name of the current git branch. OctoVersion will use this to calculate the version number. This can be set via the environment variable { CiBranchNameEnvVariable } .", Name = CiBranchNameEnvVariable ) ]
7172 string ? BranchName { get ; set ; }
7273
@@ -83,16 +84,15 @@ public Build()
8384 {
8485 // Mimic the behaviour of this attribute, but lazily so we don't pay the OctoVersion cost when it isn't needed
8586 OctoVersionInfo = new Lazy < OctoVersionInfo ? > ( ( ) =>
86- {
87- var attribute = new OctoVersionAttribute { BranchMember = nameof ( BranchName ) , Framework = "net8.0" } ;
87+ {
88+ var attribute = new OctoVersionAttribute { BranchMember = nameof ( BranchName ) , Framework = "net8.0" } ;
89+
90+ // the Attribute does all the work such as calling TeamCity.Instance?.SetBuildNumber for us
91+ var version = attribute . GetValue ( null ! , this ) ;
8892
89- // the Attribute does all the work such as calling TeamCity.Instance?.SetBuildNumber for us
90- var version = attribute . GetValue ( null ! , this ) ;
93+ return version as OctoVersionInfo ;
94+ } , LazyThreadSafetyMode . ExecutionAndPublication ) ;
9195
92- return version as OctoVersionInfo ;
93- } , LazyThreadSafetyMode . ExecutionAndPublication ) ;
94-
95-
9696 NugetVersion = new Lazy < string > ( GetNugetVersion ) ;
9797
9898 // This initialisation is required to ensure the build script can
@@ -104,7 +104,7 @@ public Build()
104104 static AbsolutePath BuildDirectory => RootDirectory / "build" ;
105105 static AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts" ;
106106 static AbsolutePath PublishDirectory => RootDirectory / "publish" ;
107- static AbsolutePath LocalPackagesDirectory => RootDirectory / ".." / "LocalPackages" ;
107+ static AbsolutePath LocalPackagesDirectory => RootDirectory / ".." / "LocalPackages" ;
108108 static AbsolutePath ConsolidateCalamariPackagesProject => SourceDirectory / "Calamari.ConsolidateCalamariPackages.Tests" / "Calamari.ConsolidateCalamariPackages.Tests.csproj" ;
109109 static AbsolutePath ConsolidatedPackageDirectory => ArtifactsDirectory / "consolidated" ;
110110 static AbsolutePath LegacyCalamariDirectory => PublishDirectory / "Calamari.Legacy" ;
@@ -562,15 +562,19 @@ void CompressCalamariProject(Project project)
562562
563563 // Create a Zip for each runtime for testing
564564 // ReSharper disable once LoopCanBeConvertedToQuery
565- foreach ( var rid in GetRuntimeIdentifiers ( Solution . GetProject ( "Calamari.Tests" ) ! ) ! )
566- actions . Add ( ( ) =>
565+ actions . Add ( ( ) =>
566+ {
567+ //run each build in sequence as it's the same project and we get issues
568+ foreach ( var rid in GetRuntimeIdentifiers ( Solution . GetProject ( "Calamari.Tests" ) ! ) )
567569 {
568570 var publishedLocation = DoPublish ( "Calamari.Tests" , Frameworks . Net60 , nugetVersion , rid ) ;
569571 var zipName = $ "Calamari.Tests.{ rid } .{ nugetVersion } .zip";
570572 File . Copy ( RootDirectory / "global.json" , publishedLocation / "global.json" ) ;
571573 CompressionTasks . Compress ( publishedLocation , ArtifactsDirectory / zipName ) ;
572- } ) ;
574+ }
575+ } ) ;
573576
577+ //I don't think this is _actually_ necessary to build...
574578 actions . Add ( ( ) =>
575579 {
576580 var testingProjectPath = SourceDirectory / "Calamari.Testing" / "Calamari.Testing.csproj" ;
@@ -698,8 +702,8 @@ void CompressCalamariProject(Project project)
698702
699703 async Task RunPackActions ( List < Action > actions )
700704 {
701- var tasks = actions . Select ( Task . Run ) . ToList ( ) ;
702- await Task . WhenAll ( tasks ) ;
705+ var tasks = actions . Select ( Task . Run ) . ToList ( ) ;
706+ await Task . WhenAll ( tasks ) ;
703707 }
704708
705709 AbsolutePath DoPublish ( string project , string framework , string version , string ? runtimeId = null )
0 commit comments