MNT: NumPy 2.0 compatibility, other fixes #85
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: Release | |
on: | |
pull_request: | |
release: | |
types: [released] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build_wheels: | |
name: Wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
if: github.repository == 'spacetelescope/synphot_refactor' | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install pip "twine>=3.3" -U | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD: 'cp38-* cp39-* cp310-* cp311-*' | |
CIBW_SKIP: '*-musllinux_*' | |
CIBW_ARCHS_LINUX: 'x86_64' | |
CIBW_ARCHS_WINDOWS: 'AMD64' | |
CIBW_ARCHS_MACOS: 'arm64' | |
CIBW_TEST_SKIP: '*-macosx_arm64' | |
CIBW_TEST_REQUIRES: 'pytest pytest-astropy' | |
CIBW_TEST_COMMAND: 'python -c "import synphot; synphot.test()"' | |
- name: Check wheels | |
run: python -m twine check --strict wheelhouse/* | |
# Upload artifacts because gh-action-pypi-publish Docker is only on Linux | |
- name: Upload wheels | |
if: github.event_name == 'release' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: additional-pylons | |
path: ./wheelhouse/*.whl | |
build_dist: | |
name: Source dist and publish | |
runs-on: ubuntu-latest | |
needs: build_wheels | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: python -m pip install pip build "twine>=3.3" -U | |
- name: Build package | |
run: python -m build --sdist . | |
- name: Check dist | |
run: python -m twine check --strict dist/* | |
- name: Test package | |
run: | | |
cd .. | |
python -m venv testenv | |
testenv/bin/pip install -U pip | |
testenv/bin/pip install pytest pytest-astropy | |
testenv/bin/pip install synphot_refactor/dist/*.tar.gz | |
testenv/bin/python -c "import synphot; synphot.test()" | |
- name: Download wheels | |
if: github.event_name == 'release' | |
uses: actions/download-artifact@v3 | |
with: | |
name: additional-pylons | |
path: dist | |
# FOR DEBUGGING ONLY: repository_url (TestPyPI) and verbose; | |
# Use appropriate token if debugging with TestPyPI | |
- name: Publish package to PyPI | |
if: github.event_name == 'release' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
#repository_url: https://test.pypi.org/legacy/ | |
#verbose: true |