Files
CoolProp/.github/workflows/python_buildwheels.yml
2022-12-07 19:58:12 +01:00

132 lines
3.5 KiB
YAML

name: Python cibuildwheel
on:
push:
branches: [ 'master', 'main', 'develop', 'actions_pypi' ]
tags: [ 'v*' ]
pull_request:
branches: [ 'master', 'main', 'develop' ]
jobs:
python_bindings:
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
python-version: [36, 37, 38, 39, 310, 311]
# Architectures 5x linux, 3x windows , 1x macos (and arm64 and x86_64)
arch: [i686, x86_64, aarch64, ppc64le, s390x, AMD64, x86, ARM64, universal2]
exclude:
- os: ubuntu
arch: AMD64
- os: ubuntu
arch: x86
- os: ubuntu
arch: ARM64
- os: ubuntu
arch: arm64
- os: ubuntu
arch: universal2
- os: windows
arch: i686
- os: windows
arch: x86_64
- os: windows
arch: aarch64
- os: windows
arch: ppc64le
- os: windows
arch: s390x
- os: windows
arch: ARM64 # creates problems with msgpack-c
- os: windows
arch: ARM64
python-version: 36
- os: windows
arch: ARM64
python-version: 37
- os: windows
arch: ARM64
python-version: 38
# - os: windows
# arch: arm64 # not case-sensitive
- os: windows
arch: universal2
- os: macos
arch: i686
- os: macos
arch: aarch64
- os: macos
arch: ppc64le
- os: macos
arch: s390x
- os: macos
arch: AMD64
- os: macos
arch: x86
# - os: macos
# arch: ARM64 # not case-sensitive
- os: macos
arch: arm64
python-version: 36
- os: macos
arch: arm64
python-version: 37
- os: macos
arch: universal2 # is redundant
uses: ./.github/workflows/python_cibuildwheel.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
arch: ${{ matrix.arch }}
upload_python_bindings_to_pypi:
needs: python_bindings
name: Upload to PyPi
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.x
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine requests packaging
if [[ "$GITHUB_REF" == *"refs/tags"* ]]; then
TWINE_REPOSITORY=pypi
TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
else
TWINE_REPOSITORY=testpypi
TWINE_PASSWORD=${{ secrets.TESTPYPI_TOKEN }}
fi;
echo "Using TWINE_REPOSITORY=$TWINE_REPOSITORY"
echo "TWINE_REPOSITORY=$TWINE_REPOSITORY" >> $GITHUB_ENV
echo "TWINE_PASSWORD=$TWINE_PASSWORD" >> $GITHUB_ENV
- name: Download ALL wheels
uses: actions/download-artifact@v3
with:
name: Python
path: Python
- name: Display structure of downloaded files
run: |
set -x
ls -R
du -sh
- name: Publish wheels to (Test)PyPI
if: ${{ github.event_name != 'pull_request' }}
env:
TWINE_USERNAME: __token__
run: |
python -m twine upload --skip-existing Python/*.whl