LimeDriverBindings/.github/workflows/python-publish.yml
2024-04-20 12:05:07 +02:00

68 lines
1.6 KiB
YAML

name: Build, Test, and Upload Python Package
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
permissions:
contents: read
jobs:
# test:
# uses: ./.github/workflows/ubuntu-python-package.yml # use the callable tests job to run tests
deploy:
runs-on: ubuntu-latest
# needs: [test]
steps:
- name: Update package list
run: |
sudo apt-get update
- name: Install git
run: |
sudo apt-get install -y git
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Prepare Python environment
run: |
python -m venv venv
. ./venv/bin/activate
pip install --upgrade pip h5py setuptools wheel build
- name: Install dependencies
run: |
sudo apt-get install -y libhdf5-dev limesuite liblimesuite-dev automake gcc pkg-config build-essential python-is-python3
- name: Build wheels with cibuildwheel
uses: pypa/cibuildwheel@v2.3.0
with:
# Only build wheels for CPython 3.10 for manylinux platforms
build: "cp310-*"
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
- name: Publish to PyPI
run: |
pip install -U twine build
python -m build .
python -m twine upload --repository pypi --username __token__ --password ${{ secrets.PYPI }} dist/*
env:
PYPI: ${{ secrets.PYPI }}