|
49 | 49 | gh auth status |
50 | 50 |
|
51 | 51 | - name: 🗑️ Delete ALL matching Releases (tag_name starts with managed prefix) |
| 52 | + id: del_releases |
52 | 53 | shell: bash |
53 | 54 | run: | |
54 | 55 | set -euo pipefail |
|
72 | 73 |
|
73 | 74 | if [[ "${#release_tags[@]}" -eq 0 ]]; then |
74 | 75 | echo "No releases found." |
| 76 | + echo "deleted_releases=0" >> "$GITHUB_OUTPUT" |
75 | 77 | exit 0 |
76 | 78 | fi |
77 | 79 |
|
|
89 | 91 | done |
90 | 92 |
|
91 | 93 | echo "Deleted releases: ${deleted}" |
| 94 | + echo "deleted_releases=${deleted}" >> "$GITHUB_OUTPUT" |
92 | 95 |
|
93 | 96 | - name: 🗑️ Delete ALL matching Tags (name starts with managed prefix) |
| 97 | + id: del_tags |
94 | 98 | shell: bash |
95 | 99 | run: | |
96 | 100 | set -euo pipefail |
@@ -121,6 +125,40 @@ jobs: |
121 | 125 | done |
122 | 126 |
|
123 | 127 | 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" |
124 | 162 |
|
125 | 163 | update-github-releases: |
126 | 164 | name: 🚀 Rebuild Managed Releases |
@@ -278,3 +316,68 @@ jobs: |
278 | 316 | artifacts/${{ matrix.release_name }}.zip |
279 | 317 | artifacts/${{ matrix.release_name }}.sha256.txt |
280 | 318 | 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