|
60 | 60 | default: false |
61 | 61 | required: false |
62 | 62 | type: boolean |
| 63 | + keep_artifacts: |
| 64 | + description: 'Keep this run''s artifacts even if it publishes nothing (artifact-only test runs)' |
| 65 | + default: false |
| 66 | + required: false |
| 67 | + type: boolean |
63 | 68 |
|
64 | 69 | permissions: |
65 | 70 | contents: read |
@@ -647,12 +652,26 @@ jobs: |
647 | 652 | done |
648 | 653 | [ "$fail" = 0 ] || { echo "ERROR: refusing to publish a partial release" >&2; exit 1; } |
649 | 654 |
|
| 655 | + # Only on a run that did NOT succeed, matching llama.cpp. Uploading this |
| 656 | + # unconditionally duplicated every bundle in the run -- measured at 1.34 GiB |
| 657 | + # per run, byte-for-byte the same content as the six -bin- artifacts beside |
| 658 | + # it. On a green publish those bytes are already release assets, and |
| 659 | + # reclaim below cannot delete this copy because an aggregate matches no |
| 660 | + # single asset name, so it was the largest survivor of every cleanup. |
| 661 | + # |
| 662 | + # !success() rather than failure(): a cancelled run is exactly when a |
| 663 | + # human wants the rescue bundle. |
650 | 664 | - name: Upload full set (artifact fallback) |
| 665 | + if: ${{ always() && !success() }} |
651 | 666 | uses: actions/upload-artifact@v4 |
652 | 667 | with: |
653 | 668 | name: unsloth-sd-prebuilt-${{ needs.resolve.outputs.tag }} |
654 | 669 | path: dist/* |
655 | | - if-no-files-found: error |
| 670 | + # warn, not error: an early failure can leave dist/ absent, and a |
| 671 | + # missing debug bundle must not turn a diagnosable failure into a |
| 672 | + # confusing second one. |
| 673 | + if-no-files-found: warn |
| 674 | + overwrite: true |
656 | 675 | retention-days: 7 |
657 | 676 |
|
658 | 677 | - name: Publish GitHub release |
@@ -782,7 +801,7 @@ jobs: |
782 | 801 | # run's release. So the rule is simply that nothing will ever consume |
783 | 802 | # these -- a publish:false dispatch is a test, and a cancelled or failed |
784 | 803 | # run is not resumable past the missing legs -- and they are deleted. |
785 | | - if: ${{ needs.assemble.outputs.published != 'true' }} |
| 804 | + if: ${{ needs.assemble.outputs.published != 'true' && inputs.keep_artifacts != true }} |
786 | 805 | continue-on-error: true |
787 | 806 | env: |
788 | 807 | GH_TOKEN: ${{ github.token }} |
|
0 commit comments