Initial commit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
name: Publish to Comfy registry
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v[0-9]+.[0-9]+.[0-9]+"
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
check-version:
|
||||
name: Check version requirements
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.repository_owner == 'Kidev' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') }}
|
||||
outputs:
|
||||
should_publish: ${{ steps.check.outputs.should_publish }}
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Compare versions
|
||||
id: check
|
||||
run: |
|
||||
VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2)
|
||||
TAG=${GITHUB_REF#refs/tags/v}
|
||||
if [ "$TAG" = "$VERSION" ]; then
|
||||
echo "should_publish=true" >> $GITHUB_OUTPUT
|
||||
echo "Versions match ($VERSION), will proceed with publish"
|
||||
else
|
||||
echo "should_publish=false" >> $GITHUB_OUTPUT
|
||||
echo "Tag version ($TAG) does not match pyproject.toml version ($VERSION), skipping publish"
|
||||
fi
|
||||
|
||||
publish:
|
||||
name: Publish package
|
||||
runs-on: ubuntu-latest
|
||||
needs: check-version
|
||||
if: needs.check-version.outputs.should_publish == 'true'
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
submodules: true
|
||||
fetch-tags: true
|
||||
|
||||
- name: Publish Custom Node
|
||||
uses: Comfy-Org/publish-node-action@v1
|
||||
with:
|
||||
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
|
||||
Reference in New Issue
Block a user