Skip to content

Commit

Permalink
Updated workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
EmanueleGiacomini committed Apr 15, 2024
1 parent 7eebb9d commit 79da583
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 75 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish to PyPI.org
on:
release:
types: [published]
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build sdist
run: pipx run build --sdist ${{github.workspace}}/python/
- name: Move sdist to dist
run: mkdir -p dist && mv ${{github.workspace}}/python/dist/*.tar.gz dist/

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

cibuildwheel:
name: Build wheels on ${{ matrix.os }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Build wheels
if: github.event_name == 'release'
uses: pypa/cibuildwheel@v2.16.5
with:
package-dir: ${{github.workspace}}/python/

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

pypi:
if: github.event_name == 'release'
needs: [cibuildwheel, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}



36 changes: 0 additions & 36 deletions .github/workflows/python-app.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/python-publish.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Python API
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
python_package:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
steps:
- uses: actions/checkout@v3
- name: Set up Python3
uses: actions/setup-python@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Build pip package
run: |
python -m pip install --verbose ./python/

0 comments on commit 79da583

Please sign in to comment.