Skip to content

Commit 78c6da7

Browse files
Update make-update-github-releases.yml
Signed-off-by: LUIZ HAMILTON ROBERTO DA SILVA <[email protected]>
1 parent da8c639 commit 78c6da7

1 file changed

Lines changed: 103 additions & 0 deletions

File tree

.github/workflows/make-update-github-releases.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
gh auth status
5050
5151
- name: 🗑️ Delete ALL matching Releases (tag_name starts with managed prefix)
52+
id: del_releases
5253
shell: bash
5354
run: |
5455
set -euo pipefail
@@ -72,6 +73,7 @@ jobs:
7273
7374
if [[ "${#release_tags[@]}" -eq 0 ]]; then
7475
echo "No releases found."
76+
echo "deleted_releases=0" >> "$GITHUB_OUTPUT"
7577
exit 0
7678
fi
7779
@@ -89,8 +91,10 @@ jobs:
8991
done
9092
9193
echo "Deleted releases: ${deleted}"
94+
echo "deleted_releases=${deleted}" >> "$GITHUB_OUTPUT"
9295
9396
- name: 🗑️ Delete ALL matching Tags (name starts with managed prefix)
97+
id: del_tags
9498
shell: bash
9599
run: |
96100
set -euo pipefail
@@ -121,6 +125,40 @@ jobs:
121125
done
122126
123127
echo "Deleted tags: ${deleted}"
128+
echo "deleted_tags=${deleted}" >> "$GITHUB_OUTPUT"
129+
130+
- name: 📋 Publish Cleanup Summary (View Runs)
131+
if: always()
132+
shell: bash
133+
run: |
134+
set -euo pipefail
135+
136+
del_rel="${{ steps.del_releases.outputs.deleted_releases || '0' }}"
137+
del_tag="${{ steps.del_tags.outputs.deleted_tags || '0' }}"
138+
139+
{
140+
echo "## 🧹 Cleanup Old Managed Releases & Tags"
141+
echo
142+
echo "- **Workflow:** \`${{ github.workflow }}\`"
143+
echo "- **Event:** \`${{ github.event_name }}\`"
144+
echo "- **Ref:** \`${{ github.ref }}\`"
145+
echo "- **Commit:** \`${{ github.sha }}\`"
146+
echo
147+
echo "### Results"
148+
echo
149+
echo "- **Deleted releases:** \`${del_rel}\`"
150+
echo "- **Deleted tags:** \`${del_tag}\`"
151+
echo
152+
echo "### Managed prefixes"
153+
echo
154+
echo '```text'
155+
for p in ${MANAGED_TAG_PREFIXES}; do echo "$p"; done
156+
echo '```'
157+
echo
158+
echo "### Notes"
159+
echo "- Release deletions are best-effort (\`|| true\`) to avoid breaking weekly maintenance."
160+
echo "- Tag deletions use REST endpoints and are paginated per prefix."
161+
} >> "$GITHUB_STEP_SUMMARY"
124162
125163
update-github-releases:
126164
name: 🚀 Rebuild Managed Releases
@@ -278,3 +316,68 @@ jobs:
278316
artifacts/${{ matrix.release_name }}.zip
279317
artifacts/${{ matrix.release_name }}.sha256.txt
280318
retention-days: 30
319+
320+
- name: 📋 Publish Release Summary (View Runs)
321+
if: always()
322+
shell: bash
323+
run: |
324+
set -euo pipefail
325+
326+
REL="${{ matrix.release_name }}"
327+
TAG="${{ steps.tag.outputs.version_tag }}"
328+
329+
ZIP="artifacts/${REL}.zip"
330+
SHA="artifacts/${REL}.sha256.txt"
331+
332+
size_bytes="0"
333+
if [[ -f "${ZIP}" ]]; then
334+
size_bytes="$(wc -c < "${ZIP}" | tr -d ' ')"
335+
fi
336+
337+
{
338+
echo "## 🚀 Release Rebuild — ${REL}"
339+
echo
340+
echo "- **Tag:** \`${TAG}\`"
341+
echo "- **Artifact:** \`${ZIP}\`"
342+
echo "- **Size (bytes):** \`${size_bytes}\`"
343+
echo
344+
echo "### Integrity"
345+
if [[ -f "${SHA}" ]]; then
346+
echo
347+
echo '```text'
348+
cat "${SHA}"
349+
echo '```'
350+
else
351+
echo "- _SHA256 file not found:_ \`${SHA}\`"
352+
fi
353+
echo
354+
echo "### Changelog"
355+
echo
356+
if [[ -n "${{ steps.changelog.outputs.body }}" ]]; then
357+
echo "${{ steps.changelog.outputs.body }}"
358+
else
359+
echo "_No changelog section extracted._"
360+
fi
361+
} >> "$GITHUB_STEP_SUMMARY"
362+
363+
summary:
364+
name: 📌 Weekly Release Maintenance Summary
365+
needs: [cleanup-github-releases, update-github-releases]
366+
runs-on: ubuntu-latest
367+
if: always()
368+
steps:
369+
- name: 📋 Publish Workflow Summary (View Runs)
370+
shell: bash
371+
run: |
372+
set -euo pipefail
373+
374+
{
375+
echo "## 📌 Weekly Release Maintenance Summary"
376+
echo
377+
echo "- **Cleanup job:** **${{ needs.cleanup-github-releases.result }}**"
378+
echo "- **Rebuild job:** **${{ needs.update-github-releases.result }}**"
379+
echo
380+
echo "### Notes"
381+
echo "- Cleanup deletes only managed prefixes."
382+
echo "- Each matrix leg publishes its own release summary with tag, artifact size, SHA256, and changelog."
383+
} >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)