Skip to content

Commit 1798ca4

Browse files
committed
also test pip build in PRs
1 parent b2d7c3a commit 1798ca4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,9 @@ jobs:
167167
# with:
168168
# recipe-path: conda-recipe/recipe.yaml
169169

170-
publish-pypi:
171-
name: Publish to PyPI
170+
pip-build:
171+
name: Build and publish to PyPI
172172
needs: test
173-
if: github.ref == 'refs/heads/main'
174173
runs-on: ubuntu-latest
175174
steps:
176175
- name: Check out the repository
@@ -204,7 +203,7 @@ jobs:
204203
205204
- name: Push tag
206205
id: tag-version
207-
if: steps.check-version.outputs.previous-version != steps.check-version.outputs.current-version
206+
if: github.ref == 'refs/heads/main' && steps.check-version.outputs.previous-version != steps.check-version.outputs.current-version
208207
uses: mathieudutour/[email protected]
209208
with:
210209
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -215,14 +214,15 @@ jobs:
215214
python -m build
216215
217216
- name: Publish package on PyPI
218-
if: steps.tag-version.outputs.new_tag
217+
if: github.ref == 'refs/heads/main' && steps.tag-version.outputs.new_tag
219218
uses: pypa/gh-action-pypi-publish@release/v1.12
220219
with:
221220
user: __token__
222221
password: "${{ secrets.PYPI_TOKEN }}"
223222
packages-dir: dist/
224223

225224
- name: Publish the release notes
225+
if: github.ref == 'refs/heads/main'
226226
uses: release-drafter/[email protected]
227227
with:
228228
publish: "${{ steps.tag-version.outputs.new_tag != '' }}"

0 commit comments

Comments
 (0)