Skip to content

v0.11.3

v0.11.3 #38

---
name: build-and-publish-to-pypi
on:
# build wheels and push to PyPI whenever a GitHub release is published
release:
types:
- published
permissions:
actions: none
checks: none
contents: read
deployments: none
discussions: none
id-token: none
issues: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
jobs:
build_wheels:
name: build wheels
runs-on: ubuntu-slim
permissions:
contents: write
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Build wheels
run: pipx run build --wheel
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: wheel
path: dist/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-slim
permissions:
contents: write
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: sdist
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'
environment:
name: pypi
url: https://pypi.org/p/pydistcheck
permissions:
id-token: write
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: sdist
path: dist
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: wheel
path: dist
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
upload_github:
needs: [upload_pypi]
runs-on: ubuntu-slim
# publish whenever a GitHub release is published
if: github.event_name == 'release' && github.event.action == 'published'
permissions:
contents: write
id-token: write
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: sdist
path: dist
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: wheel
path: dist
- name: upload distributions to release
uses: svenstaro/upload-release-action@6b7fa9f267e90b50a19fef07b3596790bb941741 # 2.11.3
with:
repo_token: ${{ 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