-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
15,060 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Needed for publishing of examples, build worker defaults to core.autocrlf=input. | ||
* text eol=autocrlf | ||
|
||
*.mof text eol=crlf | ||
*.sh text eol=lf | ||
*.svg eol=lf | ||
|
||
# Ensure any exe files are treated as binary | ||
*.exe binary | ||
*.jpg binary | ||
*.xl* binary | ||
*.pfx binary | ||
*.png binary | ||
*.dll binary | ||
*.so binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: Module Build, Test and Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- CHANGELOG.md | ||
tags: | ||
- v* | ||
tags-ignore: | ||
- '*-*' | ||
|
||
env: | ||
buildFolderName: output | ||
buildArtifactName: output | ||
testResultFolderName: testResults | ||
defaultBranch: main | ||
Agent.Source.Git.ShallowFetchDepth: 0 | ||
|
||
jobs: | ||
Build_Stage_Package_Module: | ||
name: Package Module | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Calculate ModuleVersion (GitVersion) | ||
run: | | ||
dotnet tool install --global GitVersion.Tool | ||
$gitVersionObject = dotnet-gitversion | ConvertFrom-Json | ||
$gitVersionObject.PSObject.Properties.ForEach{ | ||
Write-Host -Object "Setting Task Variable '${{ env.$_.Name }}' with value '${{ env.$_.Value }}'." | ||
Write-Host -Object "##vso[task.setvariable variable=${{ env.$_.Name }};]${{ env.$_.Value }}" | ||
} | ||
Write-Host -Object "##vso[build.updatebuildnumber]${{ env.$gitVersionObject.FullSemVer }}" | ||
shell: pwsh | ||
- name: Build & Package Module | ||
shell: powershell | ||
env: | ||
ModuleVersion: ${{ env.NuGetVersionV2 }} | ||
- name: Publish Build Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: ${{ env.buildFolderName }}/ | ||
|
||
Test_Stage_test_windows_ps: | ||
name: Windows (Windows PowerShell) | ||
runs-on: windows-latest | ||
needs: | ||
- Build_Stage_Package_Module | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download Build Artifact | ||
uses: actions/download-artifact@v2 | ||
- name: Run Tests | ||
shell: powershell | ||
- name: Publish Test Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/ | ||
name: CodeCoverageWinPS51 | ||
|
||
Test_Stage_Code_Coverage: | ||
name: Publish Code Coverage | ||
runs-on: ubuntu-latest | ||
needs: | ||
- Build_Stage_Package_Module | ||
- Test_Stage_test_windows_ps | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set Environment Variables | ||
run: | | ||
$repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/' | ||
echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner" | ||
echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName" | ||
shell: pwsh | ||
- name: Download Pipeline Artifact | ||
uses: actions/download-artifact@v2 | ||
- name: Download Test Artifact Windows (PS 5.1) | ||
uses: actions/download-artifact@v2 | ||
|
||
Deploy_Stage_Deploy_Module: | ||
name: Deploy Module | ||
runs-on: ubuntu-latest | ||
needs: | ||
- Test_Stage_test_windows_ps | ||
- Test_Stage_Code_Coverage | ||
if: (success() && ((github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/tags/')) && contains(variables['System.TeamFoundationCollectionUri'], 'MyOrgName')) | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download Build Artifact | ||
uses: actions/download-artifact@v2 | ||
- name: Publish Release | ||
shell: powershell | ||
env: | ||
GitHubToken: ${{ env.GitHubToken }} | ||
GalleryApiToken: ${{ env.GalleryApiToken }} | ||
ReleaseBranch: ${{ env.defaultBranch }} | ||
MainGitBranch: ${{ env.defaultBranch }} | ||
- name: Send Changelog PR | ||
shell: powershell | ||
env: | ||
GitHubToken: ${{ env.GitHubToken }} | ||
ReleaseBranch: ${{ env.defaultBranch }} | ||
MainGitBranch: ${{ env.defaultBranch }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
output/ | ||
|
||
**.bak | ||
*.local.* | ||
!**/README.md | ||
.kitchen/ | ||
|
||
*.nupkg | ||
*.suo | ||
*.user | ||
*.coverage | ||
.vs | ||
.psproj | ||
.sln | ||
markdownissues.txt | ||
node_modules | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@{ | ||
Severity = @('Error', | ||
'Warning') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Place your settings in this file to overwrite the default settings | ||
{ | ||
"editor.insertSpaces": true, | ||
"editor.tabSize": 4, | ||
"files.insertFinalNewline": true, | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/.DS_Store": true, | ||
"node_modules": true, | ||
"markdownissues.txt": true | ||
}, | ||
"files.trimTrailingWhitespace": true, | ||
"powershell.codeFormatting.addWhitespaceAroundPipe": true, | ||
"powershell.codeFormatting.alignPropertyValuePairs": true, | ||
"powershell.codeFormatting.autoCorrectAliases": true, | ||
"powershell.codeFormatting.avoidSemicolonsAsLineTerminators": true, | ||
"powershell.codeFormatting.ignoreOneLineBlock": false, | ||
"powershell.codeFormatting.newLineAfterCloseBrace": true, | ||
"powershell.codeFormatting.newLineAfterOpenBrace": true, | ||
"powershell.codeFormatting.openBraceOnSameLine": false, | ||
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline", | ||
"powershell.codeFormatting.preset": "Custom", | ||
"powershell.codeFormatting.trimWhitespaceAroundPipe": true, | ||
"powershell.codeFormatting.useConstantStrings": true, | ||
"powershell.codeFormatting.useCorrectCasing": true, | ||
"powershell.codeFormatting.whitespaceAfterSeparator": true, | ||
"powershell.codeFormatting.whitespaceAroundOperator": true, | ||
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true, | ||
"powershell.codeFormatting.whitespaceBeforeOpenParen": true, | ||
"powershell.codeFormatting.whitespaceBetweenParameters": true, | ||
"powershell.codeFormatting.whitespaceInsideBrace": true, | ||
"powershell.pester.useLegacyCodeLens": false, | ||
"powershell.scriptAnalysis.enable": true, | ||
"powershell.scriptAnalysis.settingsPath": ".vscode/ScriptAnalyzerSettings.psd1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
{ | ||
"version": "2.0.0", | ||
"_runner": "terminal", | ||
"windows": { | ||
"options": { | ||
"shell": { | ||
"executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", | ||
"args": [ | ||
"-NoProfile", | ||
"-ExecutionPolicy", | ||
"Bypass", | ||
"-Command" | ||
] | ||
} | ||
} | ||
}, | ||
"linux": { | ||
"options": { | ||
"shell": { | ||
"executable": "/usr/bin/pwsh", | ||
"args": [ | ||
"-NoProfile", | ||
"-Command" | ||
] | ||
} | ||
} | ||
}, | ||
"osx": { | ||
"options": { | ||
"shell": { | ||
"executable": "/usr/local/bin/pwsh", | ||
"args": [ | ||
"-NoProfile", | ||
"-Command" | ||
] | ||
} | ||
} | ||
}, | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"type": "shell", | ||
"command": "&${cwd}/build.ps1", | ||
"args": [], | ||
"presentation": { | ||
"echo": true, | ||
"reveal": "always", | ||
"focus": true, | ||
"panel": "new", | ||
"clear": false | ||
}, | ||
"runOptions": { | ||
"runOn": "default" | ||
}, | ||
"problemMatcher": [ | ||
{ | ||
"owner": "powershell", | ||
"fileLocation": [ | ||
"absolute" | ||
], | ||
"severity": "error", | ||
"pattern": [ | ||
{ | ||
"regexp": "^\\s*(\\[-\\]\\s*.*?)(\\d+)ms\\s*$", | ||
"message": 1 | ||
}, | ||
{ | ||
"regexp": "(.*)", | ||
"code": 1 | ||
}, | ||
{ | ||
"regexp": "" | ||
}, | ||
{ | ||
"regexp": "^.*,\\s*(.*):\\s*line\\s*(\\d+).*", | ||
"file": 1, | ||
"line": 2 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"label": "test", | ||
"type": "shell", | ||
"command": "&${cwd}/build.ps1", | ||
"args": ["-AutoRestore","-Tasks","test"], | ||
"presentation": { | ||
"echo": true, | ||
"reveal": "always", | ||
"focus": true, | ||
"panel": "dedicated", | ||
"showReuseMessage": true, | ||
"clear": false | ||
}, | ||
"problemMatcher": [ | ||
{ | ||
"owner": "powershell", | ||
"fileLocation": [ | ||
"absolute" | ||
], | ||
"severity": "error", | ||
"pattern": [ | ||
{ | ||
"regexp": "^\\s*(\\[-\\]\\s*.*?)(\\d+)ms\\s*$", | ||
"message": 1 | ||
}, | ||
{ | ||
"regexp": "(.*)", | ||
"code": 1 | ||
}, | ||
{ | ||
"regexp": "" | ||
}, | ||
{ | ||
"regexp": "^.*,\\s*(.*):\\s*line\\s*(\\d+).*", | ||
"file": 1, | ||
"line": 2 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Changelog for M365DSCTools | ||
|
||
The format is based on and uses the types of changes according to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
### Added | ||
|
||
- First version of this module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
mode: ContinuousDelivery | ||
next-version: 0.0.1 | ||
major-version-bump-message: '(breaking\schange|breaking|major)\b' | ||
minor-version-bump-message: '(adds?|features?|minor)\b' | ||
patch-version-bump-message: '\s?(fix|patch)' | ||
no-bump-message: '\+semver:\s?(none|skip)' | ||
assembly-informational-format: '{NuGetVersionV2}+Sha.{Sha}.Date.{CommitDate}' | ||
branches: | ||
master: | ||
tag: preview | ||
regex: ^main$ | ||
pull-request: | ||
tag: PR | ||
feature: | ||
tag: useBranchName | ||
increment: Minor | ||
regex: f(eature(s)?)?[\/-] | ||
source-branches: ['master'] | ||
hotfix: | ||
tag: fix | ||
increment: Patch | ||
regex: (hot)?fix(es)?[\/-] | ||
source-branches: ['master'] | ||
|
||
ignore: | ||
sha: [] | ||
merge-message-formats: {} | ||
|
||
|
||
# feature: | ||
# tag: useBranchName | ||
# increment: Minor | ||
# regex: f(eature(s)?)?[/-] | ||
# source-branches: ['master'] | ||
# hotfix: | ||
# tag: fix | ||
# increment: Patch | ||
# regex: (hot)?fix(es)?[/-] | ||
# source-branches: ['master'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
# M365DSCTools | ||
Various tools for a Microsoft365DSC deployment, used in the M365DSC DevOps whitepaper | ||
|
||
Various tools for M365DSC deployments | ||
|
||
## Make it yours | ||
|
||
--- | ||
Generated with Plaster and the SampleModule template | ||
|
||
|
||
This is a sample Readme | ||
|
||
## Make it yours |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@{ | ||
PSDependOptions = @{ | ||
AddToPath = $true | ||
Target = 'output\RequiredModules' | ||
Parameters = @{ | ||
Repository = 'PSGallery' | ||
} | ||
} | ||
|
||
InvokeBuild = 'latest' | ||
PSScriptAnalyzer = 'latest' | ||
Pester = 'latest' | ||
ModuleBuilder = 'latest' | ||
ChangelogManagement = 'latest' | ||
Sampler = 'latest' | ||
|
||
} | ||
|
Oops, something went wrong.