@@ -10,30 +10,42 @@ permissions:
10
10
issues : write
11
11
12
12
jobs :
13
- publish-node :
14
- name : Publish Custom Node to registry
13
+ check-version :
14
+ name : Check version requirements
15
15
runs-on : ubuntu-latest
16
+ if : ${{ github.repository_owner == 'Kidev' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') }}
17
+ outputs :
18
+ should_publish : ${{ steps.check.outputs.should_publish }}
16
19
steps :
17
20
- name : Check out code
18
21
uses : actions/checkout@v4
19
- with :
20
- submodules : true
21
22
22
- - name : Get version from pyproject.toml
23
- id : get_version
23
+ - name : Compare versions
24
+ id : check
24
25
run : |
25
26
VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2)
26
- echo "version=$VERSION" >> $GITHUB_OUTPUT
27
+ TAG=${GITHUB_REF#refs/tags/v}
28
+ if [ "$TAG" = "$VERSION" ]; then
29
+ echo "should_publish=true" >> $GITHUB_OUTPUT
30
+ echo "Versions match ($VERSION), will proceed with publish"
31
+ else
32
+ echo "should_publish=false" >> $GITHUB_OUTPUT
33
+ echo "Tag version ($TAG) does not match pyproject.toml version ($VERSION), skipping publish"
34
+ fi
27
35
28
- - name : Check version matches tag
29
- if : |
30
- github.repository_owner == 'Kidev' &&
31
- github.ref_type == 'tag' &&
32
- github.ref_name == format('v{0}', steps.get_version.outputs.version)
33
- run : echo "Version matches tag, proceeding with publish"
36
+ publish-node :
37
+ name : Publish Custom Node to registry
38
+ needs : check-version
39
+ if : ${{ needs.check-version.outputs.should_publish == 'true' }}
40
+ runs-on : ubuntu-latest
41
+ steps :
42
+ - name : Check out code
43
+ uses : actions/checkout@v4
44
+ with :
45
+ submodules : true
46
+ fetch-tags : true
34
47
35
48
- name : Publish Custom Node
36
- if : success()
37
49
uses : Comfy-Org/publish-node-action@v1
38
50
with :
39
51
personal_access_token : ${{ secrets.REGISTRY_ACCESS_TOKEN }}
0 commit comments