Merge pull request #339 from westpa/develop #3
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
name: build | |
# Build on every branch push, tag push, and pull request change: | |
#on: [push] #, pull_request] | |
# Alternatively, to publish when a (published) GitHub Release is created, use the following: | |
on: | |
push: | |
branches: | |
- 'westpa2' | |
- 'develop' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- 'westpa2' | |
release: | |
types: | |
- published | |
jobs: | |
build_wheels: | |
name: Build py3.${{ matrix.python-version }} wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: [8, 9, 10, 11] # sub-versions of Python | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_SKIP: "pp* *-musllinux*" | |
CIBW_BUILD: "cp3${{ matrix.python-version }}-*" | |
CIBW_ARCHS_MACOS: "auto64" # x86_64 only | |
CIBW_ARCHS_LINUX: "auto64" # x86_64 only | |
CIBW_TEST_SKIP: "*-macosx_arm64" | |
CIBW_DEPENDENCY_VERSIONS: "latest" | |
CIBW_TEST_COMMAND: > | |
python -c "import westpa; print(westpa.__version__)" && | |
python -c "import westpa.core.propagators" && | |
python -c "import westpa.core.binning" && | |
python -c "import westpa.core.kinetics" && | |
python -c "import westpa.core.reweight" && | |
python -c "import westpa.work_managers" && | |
python -c "import westpa.tools" && | |
python -c "import westpa.fasthist" && | |
python -c "import westpa.mclib" && | |
echo "All done with the import tests!" | |
# Currently blocked by https://github.com/westpa/westpa/issues/70 | |
#python -c "import westpa.trajtree" | |
with: | |
package-dir: . | |
output-dir: wheelhouse | |
config-file: "{package}/pyproject.toml" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
# # Split off macos arm64 building... | |
# # Disabled for now... as of 2022-10-12 | |
# # Currently creates broken arm64 wheels due to dependencies; unable to check | |
# # because macos_arm64 tests are not supported in macos_x86-64 | |
# build_wheels_macos_arm64: | |
# name: Build py3.${{ matrix.python-version }} wheels on Apple Silicon | |
# runs-on: ${{ matrix.os }} | |
# strategy: | |
# matrix: | |
# os: [macos-latest] | |
# python-version: [8, 9, 10, 11] # sub-versions of Python, there is no py3.7-macosx_arm64 | |
# | |
# steps: | |
# - uses: actions/checkout@v3 | |
# | |
# - name: Build wheels | |
# uses: pypa/[email protected] | |
# env: | |
# CIBW_SKIP: "pp*" | |
# CIBW_BUILD: "cp3${{ matrix.python-version }}-*" | |
# CIBW_ARCHS_MACOS: "arm64" | |
# CIBW_TEST_COMMAND: > | |
# python -c "import westpa; print(westpa.__version__)" && | |
# python -c "import westpa.core.propagators" && | |
# python -c "import westpa.core.binning" && | |
# python -c "import westpa.core.kinetics" && | |
# python -c "import westpa.core.reweight" && | |
# python -c "import westpa.work_managers" && | |
# python -c "import westpa.tools" && | |
# python -c "import westpa.fasthist" && | |
# python -c "import westpa.mclib" && | |
# echo "All done with the import tests!" | |
# # Currently blocked by https://github.com/westpa/westpa/issues/70 | |
# # python -c "import westpa.trajtree" | |
# with: | |
# package-dir: . | |
# output-dir: wheelhouse | |
# config-file: "{package}/pyproject.toml" | |
# | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Build sdist | |
run: pipx run build --sdist | |
- name: Install from sdist and import | |
run: | | |
python -m pip install dist/*.tar.gz && | |
python -c "import westpa; print(westpa.__version__)" && | |
python -c "import westpa.core.propagators" && | |
python -c "import westpa.core.binning" && | |
python -c "import westpa.core.kinetics" && | |
python -c "import westpa.core.reweight" && | |
python -c "import westpa.work_managers" && | |
python -c "import westpa.tools" && | |
python -c "import westpa.fasthist" && | |
python -c "import westpa.mclib" && | |
echo "All done with the import tests!" | |
# Currently blocked by https://github.com/westpa/westpa/issues/70 | |
# python -c "import westpa.trajtree" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
upload_testpypi: | |
needs: [build_wheels, build_sdist] #, build_wheels_macos_arm64] # Skipping the apple silicon versions... | |
runs-on: ubuntu-latest | |
# upload to test.PyPI on every tag starting with 'v'; only in westpa/westpa repository | |
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
# alternatively, to publish when a GitHub Release is created, use the following rule: | |
if: | | |
github.repository == 'westpa/westpa' && | |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) | |
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@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.test_pypi_upload_token }} | |
# To test: | |
repository_url: https://test.pypi.org/legacy/ | |
upload_pypi: | |
needs: [build_wheels, build_sdist] #, build_wheels_macos_arm64] # Skipping the apple silicon versions... | |
runs-on: ubuntu-latest | |
# upload to PyPI on every tag starting with 'v' | |
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
# alternatively, to publish when a GitHub Release is created, use the following rule: | |
if: | | |
github.repository == 'westpa/westpa' && | |
(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@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_upload_token }} | |
# To test: | |
#repository_url: https://test.pypi.org/legacy/ |