diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 00000000..10b97e59 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,58 @@ +name: Publish to PyPI + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - "pyproject.toml" + +jobs: + build-and-publish: + runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'ltdrdata' || github.repository_owner == 'Comfy-Org' }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + python -m pip install build twine + + - name: Get current version + id: current_version + run: | + CURRENT_VERSION=$(grep -oP 'version = "\K[^"]+' pyproject.toml) + echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT + echo "Current version: $CURRENT_VERSION" + + - name: Build package + run: python -m build + + - name: Create GitHub Release + id: create_release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: dist/* + tag_name: v${{ steps.current_version.outputs.version }} + draft: false + prerelease: false + generate_release_notes: true + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TOKEN }} + skip-existing: true + verbose: true \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 463ecca9..e47764af 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: publish-node: name: Publish Custom Node to registry runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'ltdrdata' }} + if: ${{ github.repository_owner == 'ltdrdata' || github.repository_owner == 'Comfy-Org' }} steps: - name: Check out code uses: actions/checkout@v4 diff --git a/MANIFEST.in b/MANIFEST.in index dd70bd12..8af7bc57 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,7 @@ include comfyui_manager/js/* -include comfyui_manager/*.json \ No newline at end of file +include comfyui_manager/*.json +include comfyui_manager/glob/* +include LICENSE.txt +include README.md +include requirements.txt +include pyproject.toml \ No newline at end of file