72 lines
2.4 KiB
YAML
72 lines
2.4 KiB
YAML
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
|
|
name: Publish to Comfy registry
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
paths:
|
|
- "pyproject.toml"
|
|
|
|
permissions:
|
|
issues: write
|
|
jobs:
|
|
quality:
|
|
name: Quality Gate
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
- name: Set up Python
|
|
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
with:
|
|
python-version: "3.12"
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install pytest pytest-asyncio
|
|
- name: Run tests
|
|
run: python -m pytest -q
|
|
- name: Install JS dependencies
|
|
run: npm ci --ignore-scripts
|
|
- name: Typecheck frontend
|
|
run: npx tsc -p tsconfig.json --noEmit --pretty false
|
|
- name: Build frontend bundle
|
|
run: npm run build
|
|
- name: Fail if committed dist/ is stale
|
|
run: |
|
|
if ! git diff --quiet -- dist; then
|
|
echo "::error::Committed dist/ differs from a fresh build. Run 'npm run build' and commit the result before releasing."
|
|
git diff --stat -- dist
|
|
exit 1
|
|
fi
|
|
|
|
publish-node:
|
|
name: Publish Custom Node to registry
|
|
runs-on: ubuntu-latest
|
|
needs: quality
|
|
permissions:
|
|
contents: read
|
|
if: ${{ github.repository_owner == 'MajoorWaldi' }}
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: false
|
|
- name: Publish Custom Node
|
|
uses: Comfy-Org/publish-node-action@d2366e7abb6ab16f3bb03e3520ae25c8cf749bc9 # main; fixes comfy-cli --yes removal
|
|
with:
|
|
## Add your own personal access token to your Github Repository secrets and reference it here.
|
|
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
|