|
5 | 5 | types: [ created ] |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - build-n-publish-pypi: |
| 8 | + build-n-publish-test-pypi: |
9 | 9 | name: Build and publish Python distributions to PyPI |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | permissions: |
@@ -36,15 +36,78 @@ jobs: |
36 | 36 | uses: pypa/gh-action-pypi-publish@v1.8.14 |
37 | 37 | with: |
38 | 38 | repository_url: https://test.pypi.org/legacy/ |
| 39 | + |
| 40 | + test-pypi-test-installation: |
| 41 | + name: Test Comfy CLI Installation via Test PyPi |
| 42 | + needs: build-n-publish-test-pypi |
| 43 | + runs-on: ubuntu-latest |
| 44 | + steps: |
| 45 | + - name: Set up Python |
| 46 | + uses: actions/setup-python@v4 |
| 47 | + with: |
| 48 | + python-version: '3.10' |
| 49 | + |
| 50 | + - name: Extract version from tag |
| 51 | + id: get_version |
| 52 | + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
39 | 53 |
|
40 | 54 | - name: Install Comfy CLI via pip |
| 55 | + run: pip install -i https://test.pypi.org/simple/ comfy-cli==${{env.VERSION}} |
| 56 | + |
| 57 | + - name: Test Comfy CLI Help |
| 58 | + run: comfy --help |
| 59 | + |
| 60 | + build-n-publish-pypi: |
| 61 | + name: Build and publish Python distributions to Official PyPI |
| 62 | + needs: test-pypi-test-installation |
| 63 | + runs-on: ubuntu-latest |
| 64 | + permissions: |
| 65 | + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v3 |
| 68 | + |
| 69 | + - name: Set up Python 3.10 |
| 70 | + uses: actions/setup-python@v4 |
| 71 | + with: |
| 72 | + python-version: '3.10' |
| 73 | + |
| 74 | + - name: Install build and tomlkit dependencies |
| 75 | + run: python -m pip install --upgrade pip build tomlkit |
| 76 | + |
| 77 | + - name: Extract version from tag |
| 78 | + id: get_version |
| 79 | + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
| 80 | + |
| 81 | + - name: Update version in pyproject.toml |
41 | 82 | run: | |
42 | | - pip install -i https://test.pypi.org/simple/ comfy-cli==${{env.VERSION}} |
43 | | - comfy --help |
| 83 | + sed -i "s/version = \".*\"/version = \"${{ env.VERSION }}\"/" pyproject.toml |
| 84 | +
|
| 85 | + - name: Build distribution |
| 86 | + run: python -m build --sdist --wheel --outdir dist/ |
44 | 87 |
|
45 | 88 | - name: Publish distribution to Official PyPI |
46 | 89 | uses: pypa/gh-action-pypi-publish@v1.8.14 |
47 | | - |
| 90 | + |
| 91 | + test-pip-installation: |
| 92 | + name: Test Comfy CLI Installation via pip |
| 93 | + needs: build-n-publish-pypi # This job runs after build-n-publish completes successfully |
| 94 | + runs-on: ubuntu-latest |
| 95 | + steps: |
| 96 | + - name: Set up Python |
| 97 | + uses: actions/setup-python@v4 |
| 98 | + with: |
| 99 | + python-version: '3.10' |
| 100 | + |
| 101 | + - name: Extract version from tag |
| 102 | + id: get_version |
| 103 | + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
| 104 | + |
| 105 | + - name: Install Comfy CLI via pip |
| 106 | + run: pip install comfy-cli==${{env.VERSION}} |
| 107 | + |
| 108 | + - name: Test Comfy CLI Help |
| 109 | + run: comfy --help |
| 110 | + |
48 | 111 | publish-homebrew-tap: |
49 | 112 | runs-on: ubuntu-latest |
50 | 113 | needs: build-n-publish-pypi |
@@ -108,24 +171,4 @@ jobs: |
108 | 171 | - name: Test Comfy CLI Help |
109 | 172 | run: comfy --help |
110 | 173 |
|
111 | | - |
112 | | - test-pip-installation: |
113 | | - name: Test Comfy CLI Installation via pip |
114 | | - needs: build-n-publish-pypi # This job runs after build-n-publish completes successfully |
115 | | - runs-on: ubuntu-latest |
116 | | - steps: |
117 | | - - name: Set up Python |
118 | | - uses: actions/setup-python@v4 |
119 | | - with: |
120 | | - python-version: '3.10' |
121 | | - |
122 | | - - name: Extract version from tag |
123 | | - id: get_version |
124 | | - run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
125 | | - |
126 | | - - name: Install Comfy CLI via pip |
127 | | - run: pip install comfy-cli==${{env.VERSION}} |
128 | | - |
129 | | - - name: Test Comfy CLI Help |
130 | | - run: comfy --help |
131 | 174 |
|
0 commit comments