4949env :
5050 GITHUB_TOKEN : ${{ github.token }} # Used for GitHub CLI authentication
5151
52+ permissions :
53+ contents : write
54+ pull-requests : write
55+
5256jobs :
53- Process-PSModule :
54- name : Process module
55- runs-on : ubuntu-latest
57+ TestSourceCode :
58+ name : Test source code
59+ strategy :
60+ fail-fast : false
61+ matrix :
62+ shell : [pwsh]
63+ os : [ubuntu-latest, macos-latest, windows-latest]
64+ include :
65+ - shell : powershell
66+ os : windows-latest
67+ runs-on : ${{ matrix.os }}
5668 steps :
5769 - name : Checkout Code
5870 uses : actions/checkout@v4
71+ with :
72+ fetch-depth : 0
5973
6074 - name : Initialize environment
6175 uses : PSModule/Initialize-PSModule@v1
6276 with :
6377 Version : ${{ inputs.Version }}
6478 Prerelease : ${{ inputs.Prerelease }}
79+ Shell : ${{ matrix.shell }}
6580
6681 - name : Test source code
6782 uses : PSModule/Test-PSModule@v1
6883 if : ${{ inputs.SkipTests != true }}
6984 with :
7085 Name : ${{ inputs.Name }}
7186 Path : ${{ inputs.Path }}
87+ Shell : ${{ matrix.shell }}
7288 RunModuleTests : false
7389
90+ BuildModule :
91+ name : Build module
92+ runs-on : ubuntu-latest
93+ steps :
94+ - name : Checkout Code
95+ uses : actions/checkout@v4
96+ with :
97+ fetch-depth : 0
98+
99+ - name : Initialize environment
100+ uses : PSModule/Initialize-PSModule@v1
101+ with :
102+ Version : ${{ inputs.Version }}
103+ Prerelease : ${{ inputs.Prerelease }}
104+
74105 - name : Build module
75106 uses : PSModule/Build-PSModule@v1
76107 with :
@@ -79,12 +110,116 @@ jobs:
79110 ModulesOutputPath : ${{ inputs.ModulesOutputPath }}
80111 DocsOutputPath : ${{ inputs.DocsOutputPath }}
81112
113+ - name : Upload module artifact
114+ uses : actions/upload-artifact@v4
115+ with :
116+ name : ${{ inputs.Name }}-module
117+ path : ${{ inputs.ModulesOutputPath }}
118+ if-no-files-found : error
119+ retention-days : 1
120+
121+ - name : Upload docs artifact
122+ uses : actions/upload-artifact@v4
123+ with :
124+ name : ${{ inputs.Name }}-docs
125+ path : ${{ inputs.DocsOutputPath }}
126+ if-no-files-found : error
127+ retention-days : 1
128+
129+ TestBuildModule :
130+ name : Test built module
131+ needs : BuildModule
132+ strategy :
133+ fail-fast : false
134+ matrix :
135+ shell : [pwsh]
136+ os : [ubuntu-latest, macos-latest, windows-latest]
137+ include :
138+ - shell : powershell
139+ os : windows-latest
140+ runs-on : ${{ matrix.os }}
141+ steps :
142+ - name : Initialize environment
143+ uses : PSModule/Initialize-PSModule@v1
144+ with :
145+ Version : ${{ inputs.Version }}
146+ Prerelease : ${{ inputs.Prerelease }}
147+ Shell : ${{ matrix.shell }}
148+
149+ - name : Download module artifact
150+ uses : actions/download-artifact@v4
151+ with :
152+ name : ${{ inputs.Name }}-module
153+ path : ${{ inputs.ModulesOutputPath }}
154+
82155 - name : Test built module
83156 uses : PSModule/Test-PSModule@v1
84157 if : ${{ inputs.SkipTests != true }}
85158 with :
86159 Name : ${{ inputs.Name }}
87160 Path : ${{ inputs.ModulesOutputPath }}
161+ Shell : ${{ matrix.shell }}
162+
163+ LintDocs :
164+ name : Lint documentation
165+ needs : BuildModule
166+ runs-on : ubuntu-latest
167+ steps :
168+ - name : Checkout Code
169+ uses : actions/checkout@v4
170+ with :
171+ fetch-depth : 0
172+
173+ - name : Download docs artifact
174+ uses : actions/download-artifact@v4
175+ with :
176+ name : ${{ inputs.Name }}-docs
177+ path : ${{ inputs.DocsOutputPath }}
178+
179+ - name : Git add - For linting
180+ run : |
181+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
182+ git config --global user.name "github-actions[bot]"
183+ git add .
184+ git commit -m "Update documentation"
185+
186+ - name : Lint documentation
187+ uses : super-linter/super-linter/slim@latest
188+ env :
189+ GITHUB_TOKEN : ${{ github.token }}
190+ VALIDATE_NATURAL_LANGUAGE : true
191+ VALIDATE_MARKDOWN : true
192+
193+ PublishModule :
194+ name : Publish module
195+ needs :
196+ - TestSourceCode
197+ - TestBuildModule
198+ - LintDocs
199+ runs-on : ubuntu-latest
200+ steps :
201+ - name : Checkout Code
202+ uses : actions/checkout@v4
203+ with :
204+ fetch-depth : 0
205+
206+ - name : Initialize environment
207+ uses : PSModule/Initialize-PSModule@v1
208+ with :
209+ Version : ${{ inputs.Version }}
210+ Prerelease : ${{ inputs.Prerelease }}
211+
212+ - name : Download module artifact
213+ uses : actions/download-artifact@v4
214+ with :
215+ name : ${{ inputs.Name }}-module
216+ path : ${{ inputs.ModulesOutputPath }}
217+
218+ - name : Download docs artifact
219+ uses : actions/download-artifact@v4
220+ with :
221+ name : ${{ inputs.Name }}-docs
222+ path : ${{ inputs.DocsOutputPath }}
88223
89224 - name : Publish module
90225 uses : PSModule/Publish-PSModule@v1
0 commit comments