swydd/.github/workflows/pypi.yml
dependabot[bot] 6a51158a15 build(deps): bump actions/setup-python from 3 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-18 15:35:35 -06:00

37 lines
1.1 KiB
YAML

name: Build and Publish to PyPI
on:
workflow_call:
workflow_dispatch:
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/swydd
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install pypa/build
run: >-
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: >-
python -m build --sdist --wheel --outdir dist/ .
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
# Attestations don't currently support reusable workflows
# so publishing fails if this is enabled: https://github.com/pypi/warehouse/issues/11096
attestations: false