v0.5.2 #20
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: build-and-publish-to-pypi | |
# build wheels and push to PyPI whenever a GitHub release is published | |
on: | |
push: | |
branches: | |
- build/* | |
pull_request: | |
branches: | |
- build/* | |
release: | |
types: | |
- published | |
jobs: | |
build_wheels: | |
name: build wheels | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build wheels | |
run: pipx run build --wheel | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/*.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 | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
# publish whenever a GitHub release is published | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_KEY }} | |
upload_github: | |
needs: [upload_pypi] | |
runs-on: ubuntu-latest | |
# publish whenever a GitHub release is published | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- name: upload distributions to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: dist/* | |
file_glob: true | |
tag: ${{ github.ref }} | |
overwrite: false | |
# adopted from: | |
# https://github.com/pypa/cibuildwheel/blob/0117165b02675521b3db2d05033747819bb3ecc5/examples/github-deploy.yml |