diff --git a/.github/workflows/publish_package.yml b/.github/workflows/publish_package.yml index ce10882..513f853 100644 --- a/.github/workflows/publish_package.yml +++ b/.github/workflows/publish_package.yml @@ -5,7 +5,7 @@ on: types: [ created ] jobs: - build-n-publish-pypi: + build-n-publish-test-pypi: name: Build and publish Python distributions to PyPI runs-on: ubuntu-latest permissions: @@ -36,15 +36,78 @@ jobs: uses: pypa/gh-action-pypi-publish@v1.8.14 with: repository_url: https://test.pypi.org/legacy/ + + test-pypi-test-installation: + name: Test Comfy CLI Installation via Test PyPi + needs: build-n-publish-test-pypi + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Extract version from tag + id: get_version + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - name: Install Comfy CLI via pip + run: pip install -i https://test.pypi.org/simple/ comfy-cli==${{env.VERSION}} + + - name: Test Comfy CLI Help + run: comfy --help + + build-n-publish-pypi: + name: Build and publish Python distributions to Official PyPI + needs: test-pypi-test-installation + runs-on: ubuntu-latest + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install build and tomlkit dependencies + run: python -m pip install --upgrade pip build tomlkit + + - name: Extract version from tag + id: get_version + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Update version in pyproject.toml run: | - pip install -i https://test.pypi.org/simple/ comfy-cli==${{env.VERSION}} - comfy --help + sed -i "s/version = \".*\"/version = \"${{ env.VERSION }}\"/" pyproject.toml + + - name: Build distribution + run: python -m build --sdist --wheel --outdir dist/ - name: Publish distribution to Official PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 - + + test-pip-installation: + name: Test Comfy CLI Installation via pip + needs: build-n-publish-pypi # This job runs after build-n-publish completes successfully + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Extract version from tag + id: get_version + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Install Comfy CLI via pip + run: pip install comfy-cli==${{env.VERSION}} + + - name: Test Comfy CLI Help + run: comfy --help + publish-homebrew-tap: runs-on: ubuntu-latest needs: build-n-publish-pypi @@ -108,24 +171,4 @@ jobs: - name: Test Comfy CLI Help run: comfy --help - - test-pip-installation: - name: Test Comfy CLI Installation via pip - needs: build-n-publish-pypi # This job runs after build-n-publish completes successfully - runs-on: ubuntu-latest - steps: - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Extract version from tag - id: get_version - run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - - name: Install Comfy CLI via pip - run: pip install comfy-cli==${{env.VERSION}} - - - name: Test Comfy CLI Help - run: comfy --help