Skip to content

Commit 46f7197

Browse files
committed
Add automatic deployment to PyPI
1 parent 685ad4d commit 46f7197

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/buildwheel.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,33 @@ jobs:
155155
- run: bin/install_flint_ubuntu.sh ${{ matrix.flint-tag }}
156156
- run: pip install .
157157
- run: python -m flint.test --verbose
158+
159+
# Deploy wheels and sdist to PyPI
160+
161+
pypi_release:
162+
name: Publish to PyPI
163+
needs: [build_wheels, build_sdist]
164+
# Run only when a tag is pushed to the flintlib/python-flint repo
165+
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.owner == flintlib"
166+
environment:
167+
name: pypi
168+
url: https://pypi.org/p/sympy
169+
permissions:
170+
id-token: write
171+
runs-on: ubuntu-latest
172+
173+
steps:
174+
# Downloads all artifacts
175+
- name: Download release artifacts
176+
uses: actions/download-artifact@v4
177+
with:
178+
path: wheelhouse
179+
180+
- name: Copy the PyPI files into dist
181+
run: mkdir dist && cp wheelhouse/*.whl wheelhouse/*.tar.gz dist
182+
183+
- name: Publish package on PyPI
184+
# It is recommended to pin a commit hash here for security but it
185+
# should be kept up to date. Possibly all actions and dependencies used
186+
# by the build script should be pinned...
187+
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14

0 commit comments

Comments
 (0)