Python Memory Interface #11
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
# 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: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- name: Prepare for artifact upload | |
run: | | |
mkdir out | |
mv -t out dist/*.tar.gz | |
mv -t out wheelhouse/*.whl | |
- uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: error | |
compression-level: 0 | |
path: out/ | |
test-pypi-publish: | |
name: Upload release to TestPyPI | |
needs: [build] | |
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, 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 |