Keep model prereleases out of package distribution

This commit is contained in:
Victor Kuznetsov committed 2026-09-25 13:54:06 -07:00
1 parent 0d468b6022
commit 317124ee85
3 files changed
+14 -2

No files matched your search

+2
View File
@@ -21,6 +21,8 @@ on:
jobs:
resolve:
# Model-only prereleases must not reach PyPI, Homebrew, Spaces, or ComfyUI.
if: ${{ github.event_name != 'release' || (startsWith(github.event.release.tag_name, 'v') && !github.event.release.prerelease) }}
runs-on: ubuntu-latest
# Thirty attempts may spend up to 20 seconds each in the JSON request,
# simple-index request, and inter-attempt delay. Leave bounded headroom.
+3 -1
View File
@@ -10,6 +10,8 @@ permissions:
jobs:
publish:
# Model-only prereleases are not Python package releases.
if: ${{ startsWith(github.event.release.tag_name, 'v') && !github.event.release.prerelease }}
runs-on: ubuntu-latest
environment: pypi
steps:
@@ -38,4 +40,4 @@ jobs:
# is needed. uv's uploader also accepts Metadata-Version 2.5 -- the permanent
# fix that lets the hatchling pin be relaxed (see pyproject [build-system]).
- name: Publish to PyPI
run: uv publish
run: uv publish
+9 -1
View File
@@ -102,7 +102,15 @@ catalog, paths, hashes, embeddings, and feature caches are outside this flow.
The workflow is manual and requires the model-freeze release tag plus an
explicit `publish` confirmation. Keep model-freeze GitHub releases marked as
pre-releases so a model artifact cannot replace the latest package release in
GitHub's release UI.
GitHub's release UI. Package publication and distribution jobs run only for
non-prerelease `v*` tags, so model-only prereleases cannot enter PyPI or the
package fan-out.
The newer `wiltodelta/openai-google-image-source-classifier` uses the separate
`publish-image-source-hf.yml` workflow. Its release asset is only the
hash-verified derivative `openai-google-source-v1.npz`; the workflow uploads
that artifact plus `docs/image-source-hf/README.md` and `metrics.json`. The
training corpus does not enter the library checkout or this release.
If a distribution job fails because a repository or Hugging Face credential is
invalid, rotate the corresponding GitHub secret and rerun the failed job. A