Files
Shiori AmamiyaandClaude Opus 5.5 a65a742ab1 ci: publish only on a GitHub release, never on merge (#15)
Approved by Yua at 944d7d7.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 13:10:24 -04:00

64 lines
2.1 KiB
YAML

name: Release
# Publishing is a deliberate act: it runs only when a GitHub release is
# published (Releases -> Draft a new release -> tag vX.Y.Z on main). Merging to
# main never publishes. Bump [project].version in a PR first; this workflow
# refuses a tag that does not match it.
on:
release:
types: [published]
permissions:
contents: read
jobs:
# Gate the publish on the full suite, run against the released commit.
ci:
uses: ./.github/workflows/ci.yml
# Publish to the Comfy Registry, which is what ComfyUI Manager lists.
#
# We call comfy-cli directly, pinned to an exact version, instead of
# Comfy-Org/publish-node-action: the action's pinned v1.0.1 ran
# `comfy --yes env`, which current comfy-cli rejects, and it pip-installed
# comfy-cli unpinned. Bump COMFY_CLI_VERSION deliberately and re-verify.
registry:
needs: ci
# A pre-release is for trying a build, never for Manager users.
if: ${{ !github.event.release.prerelease }}
runs-on: ubuntu-latest
permissions:
contents: read
env:
COMFY_CLI_VERSION: "1.21.0"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Check release tag matches package version
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
python - <<'PY2'
import os
import tomllib
with open("pyproject.toml", "rb") as source:
version = tomllib.load(source)["project"]["version"]
tag = os.environ["RELEASE_TAG"]
assert tag == f"v{version}", f"release tag {tag} does not match pyproject version v{version}"
PY2
- name: Install comfy-cli
run: python -m pip install "comfy-cli==${COMFY_CLI_VERSION}"
- name: Publish to Comfy Registry
env:
REGISTRY_ACCESS_TOKEN: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
run: comfy --skip-prompt --no-enable-telemetry node publish --token "$REGISTRY_ACCESS_TOKEN"