Skip to content

Commit f84a237

Browse files
authored
Update publish_package.yml
1 parent 0c43294 commit f84a237

File tree

1 file changed

+67
-24
lines changed

1 file changed

+67
-24
lines changed

.github/workflows/publish_package.yml

Lines changed: 67 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [ created ]
66

77
jobs:
8-
build-n-publish-pypi:
8+
build-n-publish-test-pypi:
99
name: Build and publish Python distributions to PyPI
1010
runs-on: ubuntu-latest
1111
permissions:
@@ -36,15 +36,78 @@ jobs:
3636
uses: pypa/gh-action-pypi-publish@v1.8.14
3737
with:
3838
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
3953

4054
- 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
4182
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/
4487

4588
- name: Publish distribution to Official PyPI
4689
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+
48111
publish-homebrew-tap:
49112
runs-on: ubuntu-latest
50113
needs: build-n-publish-pypi
@@ -108,24 +171,4 @@ jobs:
108171
- name: Test Comfy CLI Help
109172
run: comfy --help
110173

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
131174

0 commit comments

Comments
 (0)