2024-03-08 12:58:40 -06:00
|
|
|
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:
|
2025-02-10 22:58:12 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-03-08 12:58:40 -06:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python 3.9
|
2025-02-10 22:58:14 +00:00
|
|
|
uses: actions/setup-python@v5
|
2024-03-08 12:58:40 -06:00
|
|
|
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
|
2025-02-10 17:06:36 -06:00
|
|
|
with:
|
|
|
|
# Attestations don't currently support reusable workflows
|
|
|
|
# so publishing fails if this is enabled: https://github.com/pypi/warehouse/issues/11096
|
|
|
|
attestations: false
|