Skip to content
Merged
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:

jobs:
build_sdist:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: install python dependencies
run: pip install build twine

- name: build sdist
run: |
python -m build --sdist -o wheelhouse

- name: List and check sdist
run: |
ls -lh wheelhouse/
twine check wheelhouse/*
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: ./wheelhouse/*.tar.gz


build_wheels:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install python build dependencies
run: |
pip install wheel build

- name: Build wheels
run: |
python -m build --wheel
mkdir wheelhouse
mv dist/*.whl wheelhouse/
- name: List and check wheels
run: |
pip install twine pkginfo>=1.11.0
${{ matrix.ls || 'ls -lh' }} wheelhouse/
twine check wheelhouse/*
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.python-version }}
path: ./wheelhouse/*.whl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving only *.whl only copies the wheel to ./wheelhouse, so the .tar.gz isn't getting uploaded, I think. Can we just upload whatever is in dist/?


upload_to_pypi:
name: Upload to PyPI
runs-on: ubuntu-latest
if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'workflow_dispatch')
needs: [build_wheels, build_sdist]
environment:
name: pypi
url: https://pypi.org/p/fairness-indicators
permissions:
id-token: write
steps:
- name: Retrieve wheels
uses: actions/[email protected]
with:
merge-multiple: true
path: wheels

- name: List the build artifacts
run: |
ls -lAs wheels/

- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.12
with:
packages_dir: wheels/
repository_url: https://pypi.org/legacy/
verify_metadata: false
verbose: true