Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/unsloth-sd-prebuilt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ on:
default: false
required: false
type: boolean
keep_artifacts:
description: 'Keep this run''s artifacts even if it publishes nothing (artifact-only test runs)'
default: false
required: false
type: boolean

permissions:
contents: read
Expand Down Expand Up @@ -647,12 +652,26 @@ jobs:
done
[ "$fail" = 0 ] || { echo "ERROR: refusing to publish a partial release" >&2; exit 1; }

# Only on a run that did NOT succeed, matching llama.cpp. Uploading this
# unconditionally duplicated every bundle in the run -- measured at 1.34 GiB
# per run, byte-for-byte the same content as the six -bin- artifacts beside
# it. On a green publish those bytes are already release assets, and
# reclaim below cannot delete this copy because an aggregate matches no
# single asset name, so it was the largest survivor of every cleanup.
#
# !success() rather than failure(): a cancelled run is exactly when a
# human wants the rescue bundle.
- name: Upload full set (artifact fallback)
if: ${{ always() && !success() }}
uses: actions/upload-artifact@v4
with:
name: unsloth-sd-prebuilt-${{ needs.resolve.outputs.tag }}
path: dist/*
if-no-files-found: error
# warn, not error: an early failure can leave dist/ absent, and a
# missing debug bundle must not turn a diagnosable failure into a
# confusing second one.
if-no-files-found: warn
overwrite: true
retention-days: 7

- name: Publish GitHub release
Expand Down Expand Up @@ -782,7 +801,7 @@ jobs:
# run's release. So the rule is simply that nothing will ever consume
# these -- a publish:false dispatch is a test, and a cancelled or failed
# run is not resumable past the missing legs -- and they are deleted.
if: ${{ needs.assemble.outputs.published != 'true' }}
if: ${{ needs.assemble.outputs.published != 'true' && inputs.keep_artifacts != true }}
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
Expand Down
Loading