69
69
contents : read
70
70
packages : read
71
71
attestations : write
72
+ # Add an outputs section to the job to pass artifact IDs
73
+ outputs :
74
+ docs-log-id : ${{ steps.docs-log-upload.outputs.artifact-id }}
75
+ docs-id : ${{ steps.docs-upload.outputs.artifact-id }}
76
+ nuget-packages-id : ${{ steps.nuget-upload.outputs.artifact-id }}
77
+ symbols-packages-id : ${{ steps.symbols-upload.outputs.artifact-id }}
78
+ assemblies-id : ${{ steps.assemblies-upload.outputs.artifact-id }}
72
79
steps :
73
80
# Checkout the local repository
74
81
- uses : actions/checkout@v4
99
106
100
107
# Upload documentation log
101
108
- name : " Save build artifacts: Docs log"
109
+ id : docs-log-upload
102
110
uses : actions/upload-artifact@v4
103
111
with :
104
112
name : Documentation log
@@ -107,6 +115,7 @@ jobs:
107
115
108
116
# Upload documentation
109
117
- name : " Save build artifacts: Docs"
118
+ id : docs-upload
110
119
uses : actions/upload-artifact@v4
111
120
with :
112
121
name : Documentation
@@ -115,6 +124,7 @@ jobs:
115
124
116
125
# Upload NuGet packages
117
126
- name : " Save build artifacts: Nuget Packages"
127
+ id : nuget-upload
118
128
uses : actions/upload-artifact@v4
119
129
with :
120
130
name : Nuget Packages
@@ -125,6 +135,7 @@ jobs:
125
135
126
136
# Upload symbols
127
137
- name : " Save build artifacts: Symbols Packages"
138
+ id : symbols-upload
128
139
uses : actions/upload-artifact@v4
129
140
with :
130
141
name : Symbols Packages
@@ -135,6 +146,7 @@ jobs:
135
146
136
147
# Upload assemblies
137
148
- name : " Save build artifacts: Assemblies"
149
+ id : assemblies-upload
138
150
uses : actions/upload-artifact@v4
139
151
with :
140
152
name : Assemblies
@@ -187,18 +199,28 @@ jobs:
187
199
build-summary :
188
200
name : Build summary
189
201
runs-on : ubuntu-latest
190
- needs : [build-artifacts, publish-internal, upload-docs] # Add upload-docs to needs
191
- if : always() # Run this job even if other jobs fail
202
+ needs : [build-artifacts, publish-internal, upload-docs]
203
+ if : always()
192
204
steps :
193
205
- name : Generate build summary
194
206
env :
195
- # Pass job results and outputs into the step's environment
207
+ # Pass job results into the environment
196
208
RUN_TESTS_RESULT : ${{ needs.run-tests.result }}
197
209
BUILD_ARTIFACTS_RESULT : ${{ needs.build-artifacts.result }}
198
210
UPLOAD_DOCS_RESULT : ${{ needs.upload-docs.result }}
199
211
PUBLISH_INTERNAL_RESULT : ${{ needs.publish-internal.result }}
200
212
DOCS_IMAGE_TAG : ${{ needs.upload-docs.outputs.image-tag }}
213
+ DOCS_IMAGE_HASH : ${{ needs.upload-docs.outputs.image-hash}}
214
+
215
+ # Pass artifact IDs from the build-artifacts job outputs
216
+ DOCS_LOG_ID : ${{ needs.build-artifacts.outputs.docs-log-id }}
217
+ DOCS_ID : ${{ needs.build-artifacts.outputs.docs-id }}
218
+ NUGET_ID : ${{ needs.build-artifacts.outputs.nuget-packages-id }}
219
+ SYMBOLS_ID : ${{ needs.build-artifacts.outputs.symbols-packages-id }}
220
+ ASSEMBLIES_ID : ${{ needs.build-artifacts.outputs.assemblies-id }}
201
221
run : |
222
+ ARTIFACT_URL_BASE="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts"
223
+
202
224
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
203
225
echo "" >> $GITHUB_STEP_SUMMARY
204
226
echo "### Job Status" >> $GITHUB_STEP_SUMMARY
@@ -210,21 +232,25 @@ jobs:
210
232
echo "| Publish to internal NuGet | **${{ env.PUBLISH_INTERNAL_RESULT }}** |" >> $GITHUB_STEP_SUMMARY
211
233
echo "" >> $GITHUB_STEP_SUMMARY
212
234
213
- echo "### Built Artifacts" >> $GITHUB_STEP_SUMMARY
214
- echo "Links to artifacts produced by this build run:" >> $GITHUB_STEP_SUMMARY
215
- echo "" >> $GITHUB_STEP_SUMMARY
216
- echo "- [Documentation log](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/Documentation_log)" >> $GITHUB_STEP_SUMMARY
217
- echo "- [Documentation Site](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/Documentation)" >> $GITHUB_STEP_SUMMARY
218
- echo "- [Nuget Packages](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/Nuget_Packages)" >> $GITHUB_STEP_SUMMARY
219
- echo "- [Symbols Packages](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/Symbols_Packages)" >> $GITHUB_STEP_SUMMARY
220
- echo "- [Assemblies](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/Assemblies)" >> $GITHUB_STEP_SUMMARY
221
- echo "" >> $GITHUB_STEP_SUMMARY
235
+ # Only show artifacts list if the build succeeded
236
+ if [ "${{ env.BUILD_ARTIFACTS_RESULT }}" == "success" ]; then
237
+ echo "### Built Artifacts" >> $GITHUB_STEP_SUMMARY
238
+ echo "Direct links to artifacts produced by this build run:" >> $GITHUB_STEP_SUMMARY
239
+ echo "" >> $GITHUB_STEP_SUMMARY
240
+ echo "- [Documentation log]($ARTIFACT_URL_BASE/${{ env.DOCS_LOG_ID }})" >> $GITHUB_STEP_SUMMARY
241
+ echo "- [Documentation Site]($ARTIFACT_URL_BASE/${{ env.DOCS_ID }})" >> $GITHUB_STEP_SUMMARY
242
+ echo "- [Nuget Packages]($ARTIFACT_URL_BASE/${{ env.NUGET_ID }})" >> $GITHUB_STEP_SUMMARY
243
+ echo "- [Symbols Packages]($ARTIFACT_URL_BASE/${{ env.SYMBOLS_ID }})" >> $GITHUB_STEP_SUMMARY
244
+ echo "- [Assemblies]($ARTIFACT_URL_BASE/${{ env.ASSEMBLIES_ID }})" >> $GITHUB_STEP_SUMMARY
245
+ echo "" >> $GITHUB_STEP_SUMMARY
246
+ fi
222
247
223
- # Conditionally add the Docker image tag to the summary if the upload-docs job was successful
248
+ # Conditionally add the Docker image tag to the summary
224
249
if [ "${{ env.UPLOAD_DOCS_RESULT }}" == "success" ]; then
225
250
echo "### Documentation Docker Image" >> $GITHUB_STEP_SUMMARY
226
251
echo "A new documentation Docker image was pushed with the tag:" >> $GITHUB_STEP_SUMMARY
227
252
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
228
253
echo "${{ env.DOCS_IMAGE_TAG }}" >> $GITHUB_STEP_SUMMARY
254
+ echo "${{ env.DOCS_IMAGE_HASH }}" >> $GITHUB_STEP_SUMMARY
229
255
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
230
256
fi
0 commit comments