Skip to content

Commit

Permalink
Update publish_package.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
james03160927 committed May 9, 2024
1 parent 0c43294 commit f84a237
Showing 1 changed file with 67 additions and 24 deletions.
91 changes: 67 additions & 24 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit f84a237

Please sign in to comment.