Compatibility with numpy 2.0 #40
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: Continuous Deployment | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
- edited | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
FORCE_COLOR: 3 | |
jobs: | |
dist: | |
name: Distribution build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# NOTE: For simplicity, we only want to ship the sdist, and this action doesn't | |
# support turning of wheels | |
# - uses: hynek/build-and-inspect-python-package@v2 | |
- name: Build sdist | |
run: | | |
python -m pip install --upgrade build | |
python -m build --sdist . | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Packages | |
path: dist/* | |
# Upload to Test PyPI on every commit on main. | |
test-publish: | |
needs: [dist] | |
name: Test Publish to TestPyPI | |
environment: pypi | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
if: | |
github.repository_owner == 'adrn' && github.event_name == 'push' && | |
github.ref == 'refs/heads/main' | |
steps: | |
- name: Download packages built by build-and-inspect-python-package | |
uses: actions/download-artifact@v4 | |
with: | |
name: Packages | |
path: dist | |
- name: Upload package to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
publish: | |
needs: [dist] | |
name: Publish to PyPI | |
environment: pypi | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'edited') | |
steps: | |
- name: Download packages built by build-and-inspect-python-package | |
uses: actions/download-artifact@v4 | |
with: | |
name: Packages | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
if: github.event_name == 'release' && github.event.action == 'published' |