Skip to content
Merged
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"powershell.codeFormatting.preset": "Allman",
"editor.formatOnSave": true
}
150 changes: 77 additions & 73 deletions pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# winget-dsc pipeline to publish artifacts
name: '$(Build.DefinitionName)-$(Build.DefinitionVersion)-$(Date:yyyyMMdd)-$(Rev:r)'
name: "$(Build.DefinitionName)-$(Build.DefinitionVersion)-$(Date:yyyyMMdd)-$(Rev:r)"

# Commit triggers
trigger:
- main
- main

# PR triggers
pr:
branches:
include:
- main
- main
paths:
include:
- pipelines/azure-pipelines.yml
- resources/*
- tests/*
- pipelines/azure-pipelines.yml
- resources/*
- tests/*

resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
- repository: self
type: git
ref: refs/heads/main
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
Expand All @@ -33,68 +33,72 @@ extends:
image: windows-2022
os: windows
customBuildTags:
- ES365AIMigrationTooling
- ES365AIMigrationTooling
settings:
skipBuildTagsForGitHubPullRequests: true

stages:
- stage: WinGet_DSC_Artifacts_Publish
jobs:
- job: Publish_WinGet_DSC_Resources
displayName: "Publish WinGet DSC Resources"
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish Pipeline Microsoft.Windows.Developer'
targetPath: $(Build.SourcesDirectory)\resources\Microsoft.Windows.Developer\
artifactName: Microsoft.Windows.Developer
- output: pipelineArtifact
displayName: 'Publish Pipeline Microsoft.Windows.Setting.Accessibility'
targetPath: $(Build.SourcesDirectory)\resources\Microsoft.Windows.Setting.Accessibility\
artifactName: Microsoft.Windows.Setting.Accessibility
- output: pipelineArtifact
displayName: 'Publish Pipeline PythonPip3Dsc'
targetPath: $(Build.SourcesDirectory)\resources\PythonPip3Dsc\
artifactName: PythonPip3Dsc
- output: pipelineArtifact
displayName: 'Publish Pipeline YarnDsc'
targetPath: $(Build.SourcesDirectory)\resources\YarnDsc\
artifactName: YarnDsc
- output: pipelineArtifact
displayName: 'Publish Pipeline NpmDsc'
targetPath: $(Build.SourcesDirectory)\resources\NpmDsc\
artifactName: NpmDsc
- output: pipelineArtifact
displayName: 'Publish Pipeline Microsoft.WindowsSandbox.DSC'
targetPath: $(Build.SourcesDirectory)\resources\Microsoft.WindowsSandbox.DSC\
artifactName: Microsoft.WindowsSandbox.DSC
- output: pipelineArtifact
displayName: 'Publish Pipeline GitDsc'
targetPath: $(Build.SourcesDirectory)\resources\GitDsc\
artifactName: GitDsc
- output: pipelineArtifact
displayName: 'Publish Pipeline Microsoft.VSCode.Dsc'
targetPath: $(Build.SourcesDirectory)\resources\Microsoft.VSCode.Dsc\
artifactName: Microsoft.VSCode.Dsc
- stage: WinGet_DSC_Artifacts_Publish
jobs:
- job: Publish_WinGet_DSC_Resources
displayName: "Publish WinGet DSC Resources"
templateContext:
outputs:
- output: pipelineArtifact
displayName: "Publish Pipeline Microsoft.Windows.Developer"
targetPath: $(Build.SourcesDirectory)\resources\Microsoft.Windows.Developer\
artifactName: Microsoft.Windows.Developer
- output: pipelineArtifact
displayName: "Publish Pipeline Microsoft.Windows.Setting.Accessibility"
targetPath: $(Build.SourcesDirectory)\resources\Microsoft.Windows.Setting.Accessibility\
artifactName: Microsoft.Windows.Setting.Accessibility
- output: pipelineArtifact
displayName: "Publish Pipeline PythonPip3Dsc"
targetPath: $(Build.SourcesDirectory)\resources\PythonPip3Dsc\
artifactName: PythonPip3Dsc
- output: pipelineArtifact
displayName: "Publish Pipeline YarnDsc"
targetPath: $(Build.SourcesDirectory)\resources\YarnDsc\
artifactName: YarnDsc
- output: pipelineArtifact
displayName: "Publish Pipeline NpmDsc"
targetPath: $(Build.SourcesDirectory)\resources\NpmDsc\
artifactName: NpmDsc
- output: pipelineArtifact
displayName: "Publish Pipeline Microsoft.WindowsSandbox.DSC"
targetPath: $(Build.SourcesDirectory)\resources\Microsoft.WindowsSandbox.DSC\
artifactName: Microsoft.WindowsSandbox.DSC
- output: pipelineArtifact
displayName: "Publish Pipeline GitDsc"
targetPath: $(Build.SourcesDirectory)\resources\GitDsc\
artifactName: GitDsc
- output: pipelineArtifact
displayName: "Publish Pipeline Microsoft.VSCode.Dsc"
targetPath: $(Build.SourcesDirectory)\resources\Microsoft.VSCode.Dsc\
artifactName: Microsoft.VSCode.Dsc
- output: pipelineArtifact
displayName: "Publish Pipeline Microsoft.DotNet.Dsc"
targetPath: $(Build.SourcesDirectory)\resources\Microsoft.DotNet.Dsc\
artifactName: Microsoft.DotNet.Dsc

steps:
- checkout: self
clean: true
fetchTags: false

steps:
- checkout: self
clean: true
fetchTags: false

- task: PowerShell@2
displayName: "Run Pester tests for DSC modules"
inputs:
pwsh: true
targetType: "inline"
script: |
$env:PSModulePath += ";$(Build.SourcesDirectory)\resources"
Invoke-Pester -CI
workingDirectory: $(Build.SourcesDirectory)\tests\
ignoreLASTEXITCODE: true
- task: PowerShell@2
displayName: "Run Pester tests for DSC modules"
inputs:
pwsh: true
targetType: "inline"
script: |
$env:PSModulePath += ";$(Build.SourcesDirectory)\resources"
Invoke-Pester -CI
workingDirectory: $(Build.SourcesDirectory)\tests\
ignoreLASTEXITCODE: true

- task: PublishTestResults@2
inputs:
testResultsFormat: "NUnit"
testResultsFiles: "**/Test*.xml"
failTaskOnFailedTests: true
- task: PublishTestResults@2
inputs:
testResultsFormat: "NUnit"
testResultsFiles: "**/Test*.xml"
failTaskOnFailedTests: true
31 changes: 31 additions & 0 deletions resources/Microsoft.DotNet.Dsc/Microsoft.DotNet.Dsc.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@{
RootModule = 'Microsoft.DotNet.Dsc.psm1'
ModuleVersion = '0.1.0'
GUID = '2e883e78-1d91-4d08-9fc1-2a968e31009d'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = '(c) Microsoft Corporation. All rights reserved.'
Description = 'DSC Resource for .NET SDK tool installer'
PowerShellVersion = '7.2'
DscResourcesToExport = @(
'DotNetToolPackage'
)
PrivateData = @{
PSData = @{
# Tags applied to this module. These help with module discovery in online galleries.
Tags = @(
'PSDscResource_DotNetToolPackage'
)

# Prerelease string of this module
Prerelease = 'alpha'

# A URL to the license for this module.
LicenseUri = 'https://github.com/microsoft/winget-dsc/blob/main/LICENSE'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/microsoft/winget-dsc'

}
}
}
Loading