Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and upload to PyPI

# Alternatively, to publish when a (published) GitHub Release is created, use the following:
on:
push:
pull_request:
release:
types:
- published

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-11]

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/cibuildwheel@v2.11.3

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build sdist
run: |
pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# to publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.pypi_password }}
# To test: repository_url: https://test.pypi.org/legacy/
16 changes: 12 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
[build-system]
requires = [
"setuptools>=65.5.0",
"setuptools>=65.6.3",
"wheel",
"numpy<1.22",
"numpy",
"cython",
"scikit-build>=0.16.1",
"scikit-build>=0.16.3",
"cmake>=3.10.0",
"ninja",
"setuptools_scm[toml]>=7.0.5"
"setuptools_scm[toml]>=7.0.5",
]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel.macos]
skip = ["cp36-*", "cp311-*"]
before-all = "brew install homebrew/core/hdf5"

[tool.cibuildwheel.linux]
skip = ["cp36-*"]
manylinux-x86_64-image = "ghcr.io/h5py/manylinux2014_x86_64-hdf5"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
'version': version,
'packages': find_packages(where='src'),
'package_dir': {'':'src'},
'scripts': glob.glob('scripts/openmc-*'),
'cmake_install_dir': 'src/openmc',
'scripts': glob.glob('scripts/openmc-*') + ['bin/openmc'],

# Data files and libraries
'package_data': {
Expand Down