Skip to content

Use Python Memory Interface #8

Use Python Memory Interface

Use Python Memory Interface #8

Workflow file for this run

# Based on https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
name: Build and upload to PyPI
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
release:
types:
- published
jobs:
build-wheels:
name: Build wheels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
test-pypi-publish:
name: Upload release to TestPyPI
needs: [build-wheels, build-sdist]
runs-on: ubuntu-latest
environment: test-pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
pypi-publish:
name: Upload release to PyPI
needs: [build-wheels, build-sdist, test-pypi-publish]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1