Skip to content

Merge pull request #52 from astro-informatics/pin-cmake #89

Merge pull request #52 from astro-informatics/pin-cmake

Merge pull request #52 from astro-informatics/pin-cmake #89

Workflow file for this run

name: Python Build
"on":
push:
branches: ["main"]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
pull_request:
jobs:
from-sdist:
name: python source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install build packages and pytest
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install "conan<2" scikit-build pytest cython numpy
- name: Create sdist
run: python setup.py sdist
- name: Install python s2let
run: "pip install dist/pys2let-*.tar.gz"
- name: run pytest
run: pytest src/test/python/
- uses: actions/upload-artifact@v3
if: ${{ startsWith(github.ref, 'refs/tags') }}
with:
path: ./dist/*.tar.gz
name: source-distribution
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
python-version: [3.8]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: ${{ matrix.python-version }}
- name: Setup environment
run: |
python -m pip install --upgrade pip wheel
python -m pip install "conan<2" pytest
conan profile new default --detect
- name: Build wheels
run: pip wheel . --use-pep517 --no-deps -w dist
- name: install wheel
run: "pip install dist/*.whl"
- name: run pytests
run: pytest src/test/python/
- uses: actions/upload-artifact@v3
if: ${{ startsWith(github.ref, 'refs/tags') }}
with:
path: ./dist/*.whl
name: wheel-${{matrix.os}}-${{matrix.python-version}}
publication:
name: publish to pypi
if: ${{ startsWith(github.ref, 'refs/tags') }}
runs-on: ubuntu-latest
needs: [build_wheels, from-sdist]
steps:
- name: Download wheels and sdist
uses: actions/download-artifact@v3
- name: Move wheels and source distribution to dist/
run: |
mkdir -p dist
mv source-distribution/*.tar.gz wheel-*/*.whl dist
- name: Publish distribution 📦 to Test PyPI
if: ${{ github.ref != 'refs/tags/v2.2.6' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: ${{ github.ref == 'refs/tags/v2.2.6' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}