Skip to content

Update package to newest Python and Biotite versions #15

Update package to newest Python and Biotite versions

Update package to newest Python and Biotite versions #15

Workflow file for this run

# Based on the workflow from https://github.com/biotite-dev/biotite/
# contributed by Daniel Farrell (danpf) and published under the same license
name: "CI & CD"
on:
workflow_dispatch:
pull_request:
release:
types:
- published
env:
CIBW_BUILD: cp39-* cp310-* cp311-*
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ARCHS_WINDOWS: "x86 AMD64"
# Skip musllinux because it takes too long to compile on GHA
# since it is emulated. (6+ hours)
# *note* most of the build time is actually numpy for musllinux
CIBW_SKIP: "*musllinux* *-manylinux_i686 *-musllinux_i686 *-win32 pp*"
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: pytest {project} --durations=50
CIBW_DEPENDENCY_VERSIONS: "pinned"
# Runtime too long due to architecture emulation
CIBW_TEST_SKIP: "*-macosx_arm64"
jobs:
test-and-build:
name: "Build & Test"
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Build & (optionally) test wheels
uses: pypa/cibuildwheel@v2.12.1
- uses: actions/upload-artifact@v3
with:
name: dist
path: ./wheelhouse/*.whl
if-no-files-found: error
make-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Build source distribution
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.tar.gz
if-no-files-found: error
make-doc:
name: Build documentation
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: hydride
auto-update-conda: true
python-version: '3.11'
- name: Installing dependencies
run: conda install -c conda-forge sphinx cython numpy numpydoc biotite
- name: Building documentation
run: sphinx-build ./doc ./build/doc
- name: Zipping documentation
run: cd .//build; zip -r doc.zip doc; cd ..
- uses: actions/upload-artifact@v3
with:
name: doc
path: build//doc.zip
if-no-files-found: error
upload:
name: Upload to GitHub Releases & PyPI
permissions:
contents: write
needs: [test-and-build, make-sdist, make-doc]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- name: List distributions to be uploaded
run: ls dist
- name: Upload to GitHub Releases
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
if: github.event_name == 'release' && github.event.action == 'published'
with:
files: |
dist//*
doc//*
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@c7f29f7adef1a245bd91520e94867e5c6eedddcc
if: github.event_name == 'release' && github.event.action == 'published'
with:
password: ${{ secrets.PYPI_TOKEN }}