Skip to content

Merge pull request #12 from Green-Phys/molecule_files #107

Merge pull request #12 from Green-Phys/molecule_files

Merge pull request #12 from Green-Phys/molecule_files #107

Workflow file for this run

name: MBTools CI/CD
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.plat.os }}
runs-on: ${{ matrix.plat.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
plat:
- { os: ubuntu-latest, target: "", arch: x86_64}
- { os: macos-13, target: "13.0" , arch: x86_64}
- { os: macos-14, target: "14.0" , arch: arm64}
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-*
CIBW_ARCHS: ${{ matrix.plat.arch }}
CIBW_ENVIRONMENT: >
MACOSX_DEPLOYMENT_TARGET=${{ matrix.plat.target }}
# env:
# CIBW_SOME_OPTION: value
# ...
# with:
# package-dir: .
# output-dir: wheelhouse
# config-file: "{package}/pyproject.toml"
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.plat.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
#if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release'
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
#with:
# To test:
# repository-url: https://test.pypi.org/legacy/