Skip to content

Commit

Permalink
separated yamlgen compilation for windows (#1643)
Browse files Browse the repository at this point in the history
  • Loading branch information
brushknight authored May 3, 2023
1 parent 16efdc8 commit c7affda
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions build/windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,6 +45,9 @@ $goMains = @(
"$workspace\cmd\newrelic-infra"
"$workspace\cmd\newrelic-infra-ctl"
"$workspace\cmd\newrelic-infra-service"
)

$goMainsBuildInFolder = @(
"$workspace\tools\yamlgen"
)

Expand Down Expand Up @@ -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"
}

0 comments on commit c7affda

Please sign in to comment.