Skip to content

PyPI Wheels (Manual) #44

PyPI Wheels (Manual)

PyPI Wheels (Manual) #44

Workflow file for this run

name: PyPI Wheels (Manual)
on:
workflow_dispatch:
inputs:
upload:
description: 'Upload to PyPI?'
required: false
default: false
env:
CIBW_TEST_COMMAND: python {project}/src/python/test.py
CIBW_TEST_REQUIRES: numpy
CIBW_TEST_SKIP: cp310-macosx_x86_64 cp311-macosx_x86_64
jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
- name: Install deps
run: python -m pip install twine build
- name: Build SDist
run: python -m build -s
- name: Check metadata
run: twine check dist/*
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install libomp and openblas for macos
if: matrix.os == 'macos-latest'
run: |
brew install libomp
brew install openblas
- name: Build wheel
uses: pypa/[email protected]
env:
# Python 2.7 on Windows requires a workaround for C++11 support,
# built separately below
CIBW_SKIP: pp* cp27* *-win32 *_i686 *_aarch64 *_ppc64le *_s390x
- name: Show files
run: ls -lh wheelhouse
shell: bash
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
pypi-publish:
name: Upload if release
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/PyScaffolder
permissions:
id-token: write
if: github.event.inputs.upload != false
steps:
- uses: actions/setup-python@v4
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
#user: __token__
#password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true