-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (46 loc) · 1.49 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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-node:
name: Publish Custom Node to registry
needs: check-version
if: ${{ needs.check-version.outputs.should_publish == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: true
fetch-tags: true
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@v1
with:
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}