Skip to content

Commit

Permalink
add files
Browse files Browse the repository at this point in the history
  • Loading branch information
ryfu-msft committed Nov 12, 2024
1 parent b45bf90 commit 3e465f9
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 77 deletions.
55 changes: 55 additions & 0 deletions pipelines/azure-pipelines.publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# winget-dsc pipeline to publish module artifacts
name: '$(Build.DefinitionName)-$(Build.DefinitionVersion)-$(Date:yyyyMMdd)-$(Rev:r)'

trigger: none

parameters: # parameters are shown up in ADO UI in a build queue time

- name: 'Microsoft.Windows.Developer'
displayName: 'Publish Microsoft.Windows.Developer to PSGallery'
type: boolean
default: false

resources:
repositories:
- 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:
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-2022
os: windows
customBuildTags:
- ES365AIMigrationTooling
settings:
skipBuildTagsForGitHubPullRequests: true

stages:
- stage: Manual Approval
displayName: Manual Approval
dependsOn: []
jobs:
- ${{ if eq(parameters.Microsoft.Windows.Developer, false) }}:
- template: /azure-pipelines/templates/manual-trigger.yml@self
parameters:
publishTarget: Microsoft.Windows.Developer PSGallery
- template: /azure-pipelines/templates/jobs/publish/store.yml@self
parameters:
runImmediately: ${{ parameters.msstore }}

Check warning on line 45 in pipelines/azure-pipelines.publish.yml

View workflow job for this annotation

GitHub Actions / Check Spelling

`msstore` is not a recognized word. (unrecognized-spelling)
- stage: Publish pipeline artifact
jobs:
- job: Publish pipeline artifact
displayName: 'Publish Microsoft.Windows.Developer'
templateContext:
outputs:
- output: pipelineArtifact
displayName: Publish ${{ parameters.buildName }}
targetPath: $(Build.SourcesDirectory)\resources\Microsoft.Windows.Developer\
artifactName: Microsoft.Windows.Developer
105 changes: 28 additions & 77 deletions pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
# winget-dsc pipeline to publish artifacts
# winget-dsc pipeline to publish module artifacts
name: '$(Build.DefinitionName)-$(Build.DefinitionVersion)-$(Date:yyyyMMdd)-$(Rev:r)'

# Commit triggers
trigger:
- main
trigger: none

# PR triggers
pr:
branches:
include:
- main
paths:
include:
- pipelines/azure-pipelines.yml
- resources/*
- tests/*
parameters: # parameters are shown up in ADO UI in a build queue time

- name: 'Microsoft.Windows.Developer'
displayName: 'Publish Microsoft.Windows.Developer to PSGallery'
type: boolean
default: false

resources:
repositories:
Expand All @@ -38,67 +32,24 @@ extends:
skipBuildTagsForGitHubPullRequests: true

stages:
- stage: WinGet_DSC_Artifacts_Publish
- stage: Manual Approval
displayName: Manual Approval
dependsOn: []
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

- 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
- ${{ if eq(parameters.Microsoft.Windows.Developer, false) }}:
- template: /azure-pipelines/templates/manual-trigger.yml@self
parameters:
publishTarget: Microsoft.Windows.Developer PSGallery
- template: /azure-pipelines/templates/jobs/publish/store.yml@self
parameters:
runImmediately: ${{ parameters.msstore }}

Check warning on line 45 in pipelines/azure-pipelines.yml

View workflow job for this annotation

GitHub Actions / Check Spelling

`msstore` is not a recognized word. (unrecognized-spelling)
- stage: Publish pipeline artifact
jobs:
- job: Publish pipeline artifact
displayName: 'Publish Microsoft.Windows.Developer'
templateContext:
outputs:
- output: pipelineArtifact
displayName: Publish ${{ parameters.buildName }}
targetPath: $(Build.SourcesDirectory)\resources\Microsoft.Windows.Developer\
artifactName: Microsoft.Windows.Developer
15 changes: 15 additions & 0 deletions pipelines/templates/manual-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
parameters:
- name: publishTarget
type: string

jobs:
- job: ManualTrigger
displayName: Manual trigger for ${{ parameters.publishTarget }}
pool: server
timeoutInMinutes: 86400 # job times out in 60 days
steps:
- task: ManualValidation@0
timeoutInMinutes: 86400 # task times out in 60 days
inputs:
notifyUsers: ''
instructions: Approve this step to proceed with publishing for ${{ parameters.publishTarget }}

1 comment on commit 3e465f9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@check-spelling-bot Report

🔴 Please review

See the 📜action log or 📝 job summary for details.

Unrecognized words (1)

msstore

These words are not needed and should be removed cspell LASTEXITCODE NUnit Toolpackage Workaround

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the [email protected]:microsoft/winget-dsc.git repository
on the createPublishPipeline branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.24/apply.pl' |
perl - 'https://github.com/microsoft/winget-dsc/actions/runs/11805088359/attempts/1'
If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Please sign in to comment.