diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ccc302..056c15c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ stages: - test -# - release + - release variables: GIT_SSL_NO_VERIFY: "true" @@ -13,9 +13,9 @@ Test: except: - master -#Release: -# stage: release -# script: -# - .\build.ps1 -Tasks 'analyze','test','release' -# only: -# - master +Release: + stage: release + script: + - .\build.ps1 -Tasks 'test','release' + only: + - master diff --git a/build.ps1 b/build.ps1 index 3ebf83a..47ea638 100644 --- a/build.ps1 +++ b/build.ps1 @@ -40,5 +40,17 @@ foreach($task in $Tasks){ Write-Output "Running Pester Tests..." Run-Tests } + "release" { + Register-PSRepository -Name InternalPowerShellModules ` + -SourceLocation http://192.168.1.155:81/nuget/DIPowerShell ` + -PackageManagementProvider NuGet ` + -PublishLocation http://192.168.1.155:81/nuget/DIPowerShell ` + -InstallationPolicy Trusted + + Write-Output "Registerting Module" + + Import-Module $env:CI_PROJECT_PATH\SnipeitPS\SnipeitPS.psd1 -ErrorAction Stop + Publish-Module -Name SnipeitPS -Repository InternalPowerShellModules -NuGetApiKey 123456789 + } } }