diff --git a/.github/workflows/distribute.yml b/.github/workflows/distribute.yml index 2c60148..74a9c48 100644 --- a/.github/workflows/distribute.yml +++ b/.github/workflows/distribute.yml @@ -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. diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7da14ac..38501d8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 \ No newline at end of file + run: uv publish diff --git a/docs/release-and-distribution.md b/docs/release-and-distribution.md index a034a0c..b8e6d3d 100644 --- a/docs/release-and-distribution.md +++ b/docs/release-and-distribution.md @@ -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