From c7affda7b8b70cdf119e3f726f2add5680b1b160 Mon Sep 17 00:00:00 2001 From: Grigorii Merkushev Date: Wed, 3 May 2023 15:00:58 +0200 Subject: [PATCH] separated yamlgen compilation for windows (#1643) --- build/windows/build.ps1 | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/build/windows/build.ps1 b/build/windows/build.ps1 index f6fbc1c06..09f8207a3 100644 --- a/build/windows/build.ps1 +++ b/build/windows/build.ps1 @@ -37,10 +37,6 @@ if (-not $?) Write-Output "Downloading go modules..." go mod download -cd "$workspace\tools\yamlgen" -go mod download -cd "$workspace" - Write-Output "Installing goversioninfo..." $Env:Path+= ";" + $Env:GOPATH + "\bin" go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest @@ -49,6 +45,9 @@ $goMains = @( "$workspace\cmd\newrelic-infra" "$workspace\cmd\newrelic-infra-ctl" "$workspace\cmd\newrelic-infra-service" +) + +$goMainsBuildInFolder = @( "$workspace\tools\yamlgen" ) @@ -96,3 +95,19 @@ Foreach ($pkg in $goMains) SignExecutable -executable "$exe" } } + +Foreach ($pkg in $goMainsBuildInFolder) +{ + $fileName = ([io.fileinfo]$pkg).BaseName + Write-Output "creating $fileName" + + $exe = "$workspace\target\bin\windows_$arch\$fileName.exe" + + cd "$pkg" + go mod download + go build -ldflags "-X 'main.buildVersion=$version' -X 'main.gitCommit=$commit' -X 'main.buildDate=$date'" -o $exe + if (-Not $skipSigning) { + SignExecutable -executable "$exe" + } + cd "$workspace" +}