Skip to content

Commit

Permalink
Merge pull request #3 from European-XFEL/simplify-ci-packaging
Browse files Browse the repository at this point in the history
Simplify building & uploading packages in CI
  • Loading branch information
takluyver authored Jun 28, 2024
2 parents 6bae271 + 5a90dbf commit 8299f9a
Showing 1 changed file with 11 additions and 32 deletions.
43 changes: 11 additions & 32 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,52 +32,31 @@ jobs:
run: |
python3 -m pytest -v
build_wheels:
name: Build wheels
packages:
name: Build packages
needs: tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp{38,39,310,311,312}-manylinux_x86_64

- uses: actions/upload-artifact@v4
with:
name: wheels
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
output-dir: dist

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz

upload_pypi:
needs: [ build_wheels, build_sdist ]
runs-on: ubuntu-latest
# upload to PyPI on any tag on main
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
# unpack all artifacts into dist/
path: dist
merge-multiple: true
- name: List package files
run: |
ls -lh dist
# upload to PyPI on any tag on main
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
with:
user: __token__
password: ${{ secrets.pypi_token }}

0 comments on commit 8299f9a

Please sign in to comment.