From 6581b70448a2011a49f0d870b23aacb0c90d830d Mon Sep 17 00:00:00 2001 From: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> Date: Wed, 22 Jan 2025 03:36:19 +0100 Subject: [PATCH] Update publish workflow --- .github/workflows/publish.yml | 23 +++++++++++++++++------ pyproject.toml | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bd37419..88b1e79 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,12 +1,10 @@ name: Publish to Comfy registry on: - workflow_dispatch: push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' branches: - main - - master - paths: - - "pyproject.toml" permissions: issues: write @@ -15,14 +13,27 @@ jobs: publish-node: name: Publish Custom Node to registry runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'Kidev' }} steps: - name: Check out code uses: actions/checkout@v4 with: submodules: true + + - name: Get version from pyproject.toml + id: get_version + run: | + VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2) + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Check version matches tag + if: | + github.repository_owner == 'Kidev' && + github.ref_type == 'tag' && + github.ref_name == format('v{0}', steps.get_version.outputs.version) + run: echo "Version matches tag, proceeding with publish" + - name: Publish Custom Node + if: success() uses: Comfy-Org/publish-node-action@v1 with: - ## Add your own personal access token to your Github Repository secrets and reference it here. personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index 601b995..0d5bb29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "fisheye-effects" description = "Provides tools for applying and removing fisheye lens effects from images." -version = "0.0.1" +version = "0.0.2" license = {file = "LICENSE"} dependencies = ["numpy>=1.22.0", "opencv-python>=4.8.0", "Pillow>=9.5.0"]