diff --git a/builders/build-go.ps1 b/builders/build-go.ps1 index dd84a4b..e92f082 100644 --- a/builders/build-go.ps1 +++ b/builders/build-go.ps1 @@ -28,14 +28,6 @@ param( Import-Module (Join-Path $PSScriptRoot "../helpers" | Join-Path -ChildPath "nix-helpers.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "../helpers" | Join-Path -ChildPath "win-helpers.psm1") -DisableNameChecking -function Create-ArtifactDirectories { - $env:BINARIES_DIRECTORY = Join-Path $env:RUNNER_TEMP "binaries" - New-Item -Path $env:BINARIES_DIRECTORY -ItemType "directory" - - $env:ARTIFACT_DIRECTORY = Join-Path $env:RUNNER_TEMP "artifact" - New-Item -Path $env:ARTIFACT_DIRECTORY -ItemType "directory" -} - function Get-GoBuilder { <# .SYNOPSIS @@ -74,8 +66,6 @@ function Get-GoBuilder { return $builder } -Create-ArtifactDirectories - ### Create Go builder instance, and build artifact $Builder = Get-GoBuilder -Version $Version -Platform $Platform -Architecture $Architecture $Builder.Build() diff --git a/builders/go-builder.psm1 b/builders/go-builder.psm1 index 3efc496..cad3ebc 100644 --- a/builders/go-builder.psm1 +++ b/builders/go-builder.psm1 @@ -1,25 +1,25 @@ class GoBuilder { <# .SYNOPSIS - Base Go builder class. + Base Node.js builder class. .DESCRIPTION - Base Go builder class that contains general builder methods. + Base Node.js builder class that contains general builder methods. .PARAMETER Version - The version of Go that should be built. + The version of Node.js that should be built. .PARAMETER Platform - The platform of Go that should be built. + The platform of Node.js that should be built. .PARAMETER Architecture - The architecture with which Go should be built. + The architecture with which Node.js should be built. .PARAMETER TempFolderLocation - The location of temporary files that will be used during Go package generation. Using system BUILD_STAGINGDIRECTORY variable value. + The location of temporary files that will be used during Node.js package generation. .PARAMETER ArtifactLocation - The location of generated Go artifact. Using system environment BUILD_BINARIESDIRECTORY variable value. + The location of generated Node.js artifact. .PARAMETER InstallationTemplatesLocation The location of installation script template. Using "installers" folder from current repository. @@ -40,9 +40,8 @@ class GoBuilder { $this.Architecture = $architecture $this.TempFolderLocation = [IO.Path]::GetTempPath() - $this.WorkFolderLocation = $env:BINARIES_DIRECTORY - $this.ArtifactFolderLocation = $env:ARTIFACT_DIRECTORY - + $this.WorkFolderLocation = Join-Path $env:RUNNER_TEMP "binaries" + $this.ArtifactFolderLocation = Join-Path $env:RUNNER_TEMP "artifact" $this.InstallationTemplatesLocation = Join-Path -Path $PSScriptRoot -ChildPath "../installers" } @@ -95,6 +94,10 @@ class GoBuilder { Generates Go artifact from downloaded binaries. #> + Write-Host "Create WorkFolderLocation and ArtifactFolderLocation folders" + New-Item -Path $this.WorkFolderLocation -ItemType "directory" + New-Item -Path $this.ArtifactFolderLocation -ItemType "directory" + Write-Host "Download Go $($this.Version) [$($this.Architecture)] executable..." $binariesArchivePath = $this.Download() diff --git a/tests/Go.Tests.ps1 b/tests/Go.Tests.ps1 index 32041d0..3aa1a51 100644 --- a/tests/Go.Tests.ps1 +++ b/tests/Go.Tests.ps1 @@ -24,7 +24,7 @@ Describe "Go" { } It "version is correct" { - $versionOutput = '$(go version) -match "go(?\d+\.\d+\.\d+)" | Out-Null', ' $Matches.Version' | Invoke-Expression + $versionOutput = '$(go version) -match "go(?\d+\.\d+\.\d+)" | Out-Null', '$Matches.Version' | Invoke-Expression $versionOutput | Should -Match $Version }