v1.0.0 #10
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
name: Build and upload to PyPI | |
on: | |
push: | |
tags: | |
- "*" | |
release: | |
types: | |
- published | |
concurrency: | |
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}" | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build_wheels: | |
if: "github.repository == 'MDAnalysis/mdaencore'" | |
name: Build wheels | |
runs-on: ${{ matrix.buildplat[0] }} | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
buildplat: | |
- [ubuntu-20.04, manylinux_x86_64, x86_64] | |
- [macos-11, macosx_*, x86_64] | |
- [windows-2019, win_amd64, AMD64] | |
python: ["cp39", "cp310", "cp311"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
CIBW_ARCHS: ${{ matrix.buildplat[2] }} | |
CIBW_BUILD_VERBOSITY: 1 | |
- name: upload artifacts | |
if: | | |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || | |
(github.event_name == 'release' && github.event.action == 'published') | |
uses: actions/upload-artifact@v3 | |
with: | |
path: wheelhouse/*.whl | |
retention-days: 7 | |
build_sdist: | |
if: "github.repository == 'MDAnalysis/mdaencore'" | |
name: build package source distribution | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- name: upload artifacts | |
if: | | |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || | |
(github.event_name == 'release' && github.event.action == 'published') | |
uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
retention-days: 7 | |
upload_testpypi: | |
if: | | |
github.repository == 'MDAnalysis/mdaencore' && | |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) | |
name: testpypi upload | |
environment: | |
name: deploy | |
url: https://test.pypi.org/p/mdaencore | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
needs: [build_wheels, build_sdist] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- name: upload_source_and_wheels | |
uses: pypa/[email protected] | |
with: | |
skip_existing: true | |
repository_url: https://test.pypi.org/legacy/ | |
upload_pypi: | |
if: | | |
github.repository == 'MDAnalysis/mdaencore' && | |
github.event_name == 'release' && github.event.action == 'published' | |
name: pypi upload | |
environment: | |
name: deploy | |
url: https://pypi.org/p/mdaencore | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
needs: [build_wheels, build_sdist] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- name: upload_source_and_wheels | |
uses: pypa/[email protected] | |
check_testpypi: | |
if: | | |
github.repository == 'MDAnalysis/mdaencore' && | |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) | |
name: testpypi check | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
needs: upload_testpypi | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: pip install | |
run: | | |
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mdaencore | |
- name: install test deps | |
run: | | |
pip install pytest scikit-learn MDAnalysisTests | |
- name: run_tests | |
run: | | |
pytest -v --pyargs mdaencore |