Skip to content

Commit 6cee9f1

Browse files
INitial minor version (#3)
1 parent 7f1d0ed commit 6cee9f1

7 files changed

Lines changed: 221 additions & 2 deletions

File tree

.github/linters/.markdown-lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
###########################
2+
## Markdown Linter rules ##
3+
###########################
4+
5+
# Linter rules doc:
6+
# - https://github.com/DavidAnson/markdownlint
7+
8+
###############
9+
# Rules by id #
10+
###############
11+
MD004: false # Unordered list style
12+
MD007:
13+
indent: 2 # Unordered list indentation
14+
MD013:
15+
line_length: 808 # Line length
16+
MD026:
17+
punctuation: ".,;:!。,;:" # List of not allowed
18+
MD029: false # Ordered list item prefix
19+
MD033: false # Allow inline HTML
20+
MD036: false # Emphasis used instead of a heading
21+
22+
#################
23+
# Rules by tags #
24+
#################
25+
blank_lines: false # Error on blank lines

.github/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes
2+
3+
changelog:
4+
categories:
5+
- title: Breaking Changes
6+
labels:
7+
- Major
8+
- Breaking
9+
- title: New Features
10+
labels:
11+
- Minor
12+
- Feature
13+
- Improvement
14+
- Enhancement
15+
- title: Other Changes
16+
labels:
17+
- '*'

.github/workflows/Auto-Release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Auto-Release
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
- closed
9+
- opened
10+
- reopened
11+
- synchronize
12+
- labeled
13+
14+
concurrency:
15+
group: ${{ github.workflow }}
16+
17+
jobs:
18+
Auto-Release:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout Code
22+
uses: actions/checkout@v4
23+
24+
- name: Auto-Release
25+
uses: PSModule/Auto-Release@v1
26+
env:
27+
GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication

.github/workflows/Linter.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Linter
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
Lint:
8+
name: Lint code base
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repo
12+
uses: actions/checkout@v4
13+
14+
- name: Lint code base
15+
uses: github/super-linter@latest
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Verify Workflow
2+
3+
on:
4+
workflow_call:
5+
push:
6+
paths:
7+
- workflow.yml
8+
- .github/workflows/Workflow-Test.yml
9+
10+
jobs:
11+
DefaultTest:
12+
uses: ./.github/workflows/workflow.yml
13+
secrets: inherit

.github/workflows/workflow.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Process-PSModule
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
APIKey:
7+
description: The API key to use when publishing modules
8+
required: true
9+
GH_TOKEN:
10+
description: The GitHub token to use when testing and modules
11+
required: false
12+
inputs:
13+
TestModuleSkip:
14+
type: boolean
15+
description: Skip testing built module
16+
required: false
17+
default: false
18+
TestModuleErrorAction:
19+
type: string
20+
description: The ErrorActionPreference to use when running tests on built module
21+
required: false
22+
default: Stop
23+
TestSrcSkip:
24+
type: boolean
25+
description: Skip testing source code
26+
required: false
27+
default: false
28+
TestSrcErrorAction:
29+
type: string
30+
description: The ErrorActionPreference to use when running tests on source code
31+
required: false
32+
default: Stop
33+
Version:
34+
type: string
35+
description: The version of the PSModule.FX to use
36+
required: false
37+
38+
jobs:
39+
Get-PSModuleNames:
40+
name: Get modules to process in repo
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout Code
44+
uses: actions/checkout@v4
45+
46+
- name: Get-PSModuleNames
47+
id: Get-PSModuleNames
48+
shell: pwsh
49+
run: |
50+
# Get-PSModuleNames
51+
Write-Output "##[group]Get-PSModuleNames"
52+
$srcPath = (Join-Path $env:GITHUB_WORKSPACE 'src')
53+
$moduleNames = @()
54+
$moduleNames += Get-ChildItem -Path $srcPath -Directory | Select-Object -ExpandProperty Name
55+
$moduleNames = $moduleNames | ConvertTo-Json -AsArray -Compress
56+
Write-Verbose "ModuleNames=$moduleNames" -Verbose
57+
Write-Output "ModuleNames=$moduleNames" >> $env:GITHUB_OUTPUT
58+
Write-Output "##[endgroup]"
59+
outputs:
60+
ModuleNames: ${{ steps.Get-PSModuleNames.outputs.ModuleNames }}
61+
62+
Process-PSModule:
63+
name: Process module
64+
runs-on: ubuntu-latest
65+
needs:
66+
- Get-PSModuleNames
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
ModuleName: ${{ fromJson(needs.Get-PSModuleNames.outputs.ModuleNames) }}
71+
steps:
72+
- name: Checkout Code
73+
uses: actions/checkout@v4
74+
75+
- name: Initialize environment
76+
uses: PSModule/Initialize-PSModule@main
77+
with:
78+
Version: ${{ inputs.Version }}
79+
80+
- name: Test source code
81+
uses: PSModule/Test-PSModule@main
82+
if: ${{ inputs.TestSrcSkip == false }}
83+
with:
84+
Name: ${{ matrix.ModuleName }}
85+
Path: src
86+
ErrorAction: ${{ inputs.TestSrcErrorAction }}
87+
88+
- name: Build module
89+
uses: PSModule/Build-PSModule@main
90+
with:
91+
Name: ${{ matrix.ModuleName }}
92+
93+
- name: Test built module
94+
uses: PSModule/Test-PSModule@main
95+
if: ${{ inputs.TestModuleSkip == false }}
96+
with:
97+
Name: ${{ matrix.ModuleName }}
98+
Path: outputs
99+
ErrorAction: ${{ inputs.TestModuleErrorAction }}
100+
CustomTestsPath: tests
101+
env:
102+
GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication
103+
104+
- name: Publish module
105+
uses: PSModule/Publish-PSModule@main
106+
with:
107+
APIKey: ${{ secrets.APIKEY }}
108+
Name: ${{ matrix.ModuleName }}
109+
env:
110+
GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
# Actions
2-
Repo for GitHub actions and workflows
1+
# Process-PSModule
2+
3+
Repository for the PSModule Process-PSModule workflow template.
4+
It stiches together the Initialize, Build, Test, and Publish workflows to create a complete CI/CD pipeline for PowerShell modules.
5+
6+
## Usage
7+
8+
To be added.
9+
10+
## More information about workflow templates
11+
12+
- [Reusing workflows](https://docs.github.com/en/actions/using-workflows/reusing-workflows)

0 commit comments

Comments
 (0)