-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
7f1d0ed
commit 6cee9f1
Showing
7 changed files
with
221 additions
and
2 deletions.
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,25 @@ | ||
########################### | ||
## Markdown Linter rules ## | ||
########################### | ||
|
||
# Linter rules doc: | ||
# - https://github.com/DavidAnson/markdownlint | ||
|
||
############### | ||
# Rules by id # | ||
############### | ||
MD004: false # Unordered list style | ||
MD007: | ||
indent: 2 # Unordered list indentation | ||
MD013: | ||
line_length: 808 # Line length | ||
MD026: | ||
punctuation: ".,;:!。,;:" # List of not allowed | ||
MD029: false # Ordered list item prefix | ||
MD033: false # Allow inline HTML | ||
MD036: false # Emphasis used instead of a heading | ||
|
||
################# | ||
# Rules by tags # | ||
################# | ||
blank_lines: false # Error on blank lines |
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 @@ | ||
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes | ||
|
||
changelog: | ||
categories: | ||
- title: Breaking Changes | ||
labels: | ||
- Major | ||
- Breaking | ||
- title: New Features | ||
labels: | ||
- Minor | ||
- Feature | ||
- Improvement | ||
- Enhancement | ||
- title: Other Changes | ||
labels: | ||
- '*' |
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,27 @@ | ||
name: Auto-Release | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
- opened | ||
- reopened | ||
- synchronize | ||
- labeled | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
jobs: | ||
Auto-Release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Auto-Release | ||
uses: PSModule/Auto-Release@v1 | ||
env: | ||
GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication |
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 @@ | ||
name: Linter | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
Lint: | ||
name: Lint code base | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Lint code base | ||
uses: github/super-linter@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,13 @@ | ||
name: Verify Workflow | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
paths: | ||
- workflow.yml | ||
- .github/workflows/Workflow-Test.yml | ||
|
||
jobs: | ||
DefaultTest: | ||
uses: ./.github/workflows/workflow.yml | ||
secrets: inherit |
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,110 @@ | ||
name: Process-PSModule | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
APIKey: | ||
description: The API key to use when publishing modules | ||
required: true | ||
GH_TOKEN: | ||
description: The GitHub token to use when testing and modules | ||
required: false | ||
inputs: | ||
TestModuleSkip: | ||
type: boolean | ||
description: Skip testing built module | ||
required: false | ||
default: false | ||
TestModuleErrorAction: | ||
type: string | ||
description: The ErrorActionPreference to use when running tests on built module | ||
required: false | ||
default: Stop | ||
TestSrcSkip: | ||
type: boolean | ||
description: Skip testing source code | ||
required: false | ||
default: false | ||
TestSrcErrorAction: | ||
type: string | ||
description: The ErrorActionPreference to use when running tests on source code | ||
required: false | ||
default: Stop | ||
Version: | ||
type: string | ||
description: The version of the PSModule.FX to use | ||
required: false | ||
|
||
jobs: | ||
Get-PSModuleNames: | ||
name: Get modules to process in repo | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get-PSModuleNames | ||
id: Get-PSModuleNames | ||
shell: pwsh | ||
run: | | ||
# Get-PSModuleNames | ||
Write-Output "##[group]Get-PSModuleNames" | ||
$srcPath = (Join-Path $env:GITHUB_WORKSPACE 'src') | ||
$moduleNames = @() | ||
$moduleNames += Get-ChildItem -Path $srcPath -Directory | Select-Object -ExpandProperty Name | ||
$moduleNames = $moduleNames | ConvertTo-Json -AsArray -Compress | ||
Write-Verbose "ModuleNames=$moduleNames" -Verbose | ||
Write-Output "ModuleNames=$moduleNames" >> $env:GITHUB_OUTPUT | ||
Write-Output "##[endgroup]" | ||
outputs: | ||
ModuleNames: ${{ steps.Get-PSModuleNames.outputs.ModuleNames }} | ||
|
||
Process-PSModule: | ||
name: Process module | ||
runs-on: ubuntu-latest | ||
needs: | ||
- Get-PSModuleNames | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ModuleName: ${{ fromJson(needs.Get-PSModuleNames.outputs.ModuleNames) }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize environment | ||
uses: PSModule/Initialize-PSModule@main | ||
with: | ||
Version: ${{ inputs.Version }} | ||
|
||
- name: Test source code | ||
uses: PSModule/Test-PSModule@main | ||
if: ${{ inputs.TestSrcSkip == false }} | ||
with: | ||
Name: ${{ matrix.ModuleName }} | ||
Path: src | ||
ErrorAction: ${{ inputs.TestSrcErrorAction }} | ||
|
||
- name: Build module | ||
uses: PSModule/Build-PSModule@main | ||
with: | ||
Name: ${{ matrix.ModuleName }} | ||
|
||
- name: Test built module | ||
uses: PSModule/Test-PSModule@main | ||
if: ${{ inputs.TestModuleSkip == false }} | ||
with: | ||
Name: ${{ matrix.ModuleName }} | ||
Path: outputs | ||
ErrorAction: ${{ inputs.TestModuleErrorAction }} | ||
CustomTestsPath: tests | ||
env: | ||
GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication | ||
|
||
- name: Publish module | ||
uses: PSModule/Publish-PSModule@main | ||
with: | ||
APIKey: ${{ secrets.APIKEY }} | ||
Name: ${{ matrix.ModuleName }} | ||
env: | ||
GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication |
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,12 @@ | ||
# Actions | ||
Repo for GitHub actions and workflows | ||
# Process-PSModule | ||
|
||
Repository for the PSModule Process-PSModule workflow template. | ||
It stiches together the Initialize, Build, Test, and Publish workflows to create a complete CI/CD pipeline for PowerShell modules. | ||
|
||
## Usage | ||
|
||
To be added. | ||
|
||
## More information about workflow templates | ||
|
||
- [Reusing workflows](https://docs.github.com/en/actions/using-workflows/reusing-workflows) |