mirror of
https://github.com/PowerShell/PSDesiredStateConfiguration
synced 2026-06-21 13:45:25 +00:00
Update CI system for PsPackageProject release 0.1.13 (#23)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
# Do NOT edit this file. Edit dobuild.ps1
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingWriteHost", "")]
|
||||
param (
|
||||
[Parameter(ParameterSetName="build")]
|
||||
[switch]
|
||||
@@ -10,6 +12,13 @@ param (
|
||||
[switch]
|
||||
$Build,
|
||||
|
||||
[Parameter(ParameterSetName="publish")]
|
||||
[switch]
|
||||
$Publish,
|
||||
[Parameter(ParameterSetName="publish")]
|
||||
[switch]
|
||||
$Signed,
|
||||
|
||||
[Parameter(ParameterSetName="build")]
|
||||
[switch]
|
||||
$Test,
|
||||
@@ -29,13 +38,24 @@ $config = Get-PSPackageProjectConfiguration -ConfigPath $PSScriptRoot
|
||||
$script:ModuleName = $config.ModuleName
|
||||
$script:SrcPath = $config.SourcePath
|
||||
$script:OutDirectory = $config.BuildOutputPath
|
||||
$script:SignedDirectory = $config.SignedOutputPath
|
||||
$script:TestPath = $config.TestPath
|
||||
|
||||
$script:ModuleRoot = $PSScriptRoot
|
||||
$script:Culture = $config.Culture
|
||||
$script:HelpPath = $config.HelpPath
|
||||
|
||||
. "$PSScriptRoot\dobuild.ps1"
|
||||
if ($env:TF_BUILD) {
|
||||
$vstsCommandString = "vso[task.setvariable variable=BUILD_OUTPUT_PATH]$OutDirectory"
|
||||
Write-Host ("sending " + $vstsCommandString)
|
||||
Write-Host "##$vstsCommandString"
|
||||
|
||||
$vstsCommandString = "vso[task.setvariable variable=SIGNED_OUTPUT_PATH]$SignedDirectory"
|
||||
Write-Host ("sending " + $vstsCommandString)
|
||||
Write-Host "##$vstsCommandString"
|
||||
}
|
||||
|
||||
. $PSScriptRoot\dobuild.ps1
|
||||
|
||||
if ( ! ( Get-Module -ErrorAction SilentlyContinue PSPackageProject) ) {
|
||||
Install-Module PSPackageProject
|
||||
@@ -58,7 +78,12 @@ else
|
||||
if ($Build.IsPresent)
|
||||
{
|
||||
$sb = (Get-Item Function:DoBuild).ScriptBlock
|
||||
Invoke-PSPackageProjectBuild -BuildScript $sb
|
||||
Invoke-PSPackageProjectBuild -BuildScript $sb -SkipPublish
|
||||
}
|
||||
|
||||
if ($Publish.IsPresent)
|
||||
{
|
||||
Invoke-PSPackageProjectPublish -Signed:$Signed.IsPresent
|
||||
}
|
||||
|
||||
if ( $Test.IsPresent ) {
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
#####################################################
|
||||
# Do NOT edit anything outside the DoBuild function.
|
||||
# You can define functions inside the scope of DoBuild.
|
||||
#####################################################
|
||||
|
||||
<#
|
||||
.DESCRIPTION
|
||||
Implement build and packaging of the package and place the output $OutDirectory/$ModuleName
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"HelpPath": "help",
|
||||
"ModuleName": "PSDesiredStateConfiguration",
|
||||
"BuildOutputPath": "out",
|
||||
"SignedOutputPath": "signed",
|
||||
"SourcePath": "src/PSDesiredStateConfiguration",
|
||||
"TestPath": "test",
|
||||
"Culture": "en-US"
|
||||
|
||||
+13
-1
@@ -23,15 +23,27 @@ stages:
|
||||
- pwsh: |
|
||||
Install-Module -Name "platyPS","Pester" -Force
|
||||
displayName: Install dependencies
|
||||
timeoutInMinutes: 10
|
||||
- pwsh: |
|
||||
Install-Module -Name "PSScriptAnalyzer" -RequiredVersion 1.18.0 -Force
|
||||
displayName: Install PSScriptAnalyzer
|
||||
timeoutInMinutes: 10
|
||||
- pwsh: |
|
||||
Install-Module -Name PSPackageProject -Force
|
||||
displayName: Install PSPackageProject module
|
||||
timeoutInMinutes: 10
|
||||
- pwsh: |
|
||||
$(Build.SourcesDirectory)/build.ps1 -Build
|
||||
displayName: Build and publish artifact
|
||||
displayName: Build
|
||||
- pwsh: |
|
||||
Write-Verbose "BUILD_OUTPUT_PATH- $env:BUILD_OUTPUT_PATH" -Verbose
|
||||
Write-Verbose "SIGNED_OUTPUT_PATH- $env:SIGNED_OUTPUT_PATH" -Verbose
|
||||
Copy-Item $env:BUILD_OUTPUT_PATH $env:SIGNED_OUTPUT_PATH -Recurse -Force
|
||||
displayName: Build Signing Placeholder
|
||||
- pwsh: |
|
||||
$(Build.SourcesDirectory)/build.ps1 -Publish -Signed
|
||||
displayName: Publish
|
||||
timeoutInMinutes: 10
|
||||
|
||||
- stage: Test
|
||||
displayName: Test Package
|
||||
|
||||
+6
-3
@@ -59,11 +59,13 @@ jobs:
|
||||
- ${{ parameters.powershellExecutable }}: |
|
||||
Install-Module -Name "platyPS","Pester" -Force
|
||||
displayName: Install dependencies
|
||||
timeoutInMinutes: 10
|
||||
|
||||
- ${{ parameters.powershellExecutable }}: |
|
||||
Install-Module -Name "PSScriptAnalyzer" -RequiredVersion 1.18.0 -Force
|
||||
displayName: Install dependencies
|
||||
|
||||
timeoutInMinutes: 10
|
||||
|
||||
- ${{ parameters.powershellExecutable }}: |
|
||||
Install-Module -Name PSPackageProject -Force
|
||||
displayName: Install PSPackageProject module
|
||||
@@ -85,6 +87,7 @@ jobs:
|
||||
$moduleName = $config.ModuleName
|
||||
Save-Module -Repository $sourceName -Name $moduleName -Path $config.BuildOutputPath
|
||||
displayName: Extract product artifact
|
||||
timeoutInMinutes: 10
|
||||
|
||||
- ${{ parameters.powershellExecutable }}: |
|
||||
Invoke-PSPackageProjectTest -Type Functional
|
||||
@@ -96,10 +99,10 @@ jobs:
|
||||
displayName: Execute static analysis tests
|
||||
errorActionPreference: continue
|
||||
condition: succeededOrFailed()
|
||||
continueOnError: true
|
||||
|
||||
|
||||
- ${{ parameters.powershellExecutable }}: |
|
||||
Unregister-PSRepository -Name 'pspackageproject-local-repo' -ErrorAction Ignore
|
||||
displayName: Unregister temporary PSRepository
|
||||
condition: always()
|
||||
|
||||
timeoutInMinutes: 10
|
||||
|
||||
Reference in New Issue
Block a user