separate the builds for windows and linux #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build-wheel: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ["3.11"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install ifort (Windows) | |
if: matrix.os == 'windows-latest' | |
uses: fortran-lang/setup-fortran@v1 | |
with: | |
compiler: intel | |
version: "2024.0" | |
- name: Install build dependencies (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install cibuildwheel | |
- name: Install build dependencies (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
python -m pip install --upgrade pip wheel build | |
python -m pip install -r requirements-build.txt | |
- name: Build wheel (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
env: | |
CIBW_BUILD: "cp{311,312}-manylinux_x86_64" | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 | |
CIBW_BEFORE_BUILD: "pip install -r requirements-build.txt" | |
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*" | |
run: | | |
cibuildwheel --output-dir dist | |
- name: Build wheel (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
python -m build --wheel --outdir dist/ | |
- name: Upload Python Package to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
python -m pip install twine | |
python -m twine upload dist/* |