49
49
env :
50
50
GITHUB_TOKEN : ${{ github.token }} # Used for GitHub CLI authentication
51
51
52
+ permissions :
53
+ contents : write
54
+ pull-requests : write
55
+
52
56
jobs :
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 }}
56
68
steps :
57
69
- name : Checkout Code
58
70
uses : actions/checkout@v4
71
+ with :
72
+ fetch-depth : 0
59
73
60
74
- name : Initialize environment
61
75
uses : PSModule/Initialize-PSModule@v1
62
76
with :
63
77
Version : ${{ inputs.Version }}
64
78
Prerelease : ${{ inputs.Prerelease }}
79
+ Shell : ${{ matrix.shell }}
65
80
66
81
- name : Test source code
67
82
uses : PSModule/Test-PSModule@v1
68
83
if : ${{ inputs.SkipTests != true }}
69
84
with :
70
85
Name : ${{ inputs.Name }}
71
86
Path : ${{ inputs.Path }}
87
+ Shell : ${{ matrix.shell }}
72
88
RunModuleTests : false
73
89
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
+
74
105
- name : Build module
75
106
uses : PSModule/Build-PSModule@v1
76
107
with :
@@ -79,12 +110,116 @@ jobs:
79
110
ModulesOutputPath : ${{ inputs.ModulesOutputPath }}
80
111
DocsOutputPath : ${{ inputs.DocsOutputPath }}
81
112
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
+
82
155
- name : Test built module
83
156
uses : PSModule/Test-PSModule@v1
84
157
if : ${{ inputs.SkipTests != true }}
85
158
with :
86
159
Name : ${{ inputs.Name }}
87
160
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 }}
88
223
89
224
- name : Publish module
90
225
uses : PSModule/Publish-PSModule@v1
0 commit comments