Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 41 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,52 @@ on:

name: release

permissions:
# Trusted Publishing + attestations
id-token: write
attestations: write
permissions: {}

jobs:
pypi:
name: upload release to PyPI
build:
name: Build distributions 📦
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4

- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
with:
python-version-file: pyproject.toml
cache: "pip"
cache-dependency-path: pyproject.toml
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
with:
python-version-file: pyproject.toml
cache: "pip"
cache-dependency-path: pyproject.toml

- name: deps
run: python -m pip install -U setuptools build wheel
- name: Install pypa/build
run: python -m pip install -U build

- name: build
run: python -m build
- name: Build distributions
run: python -m build

- name: publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
- name: Upload distributions
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
with:
name: distributions
path: dist/


publish:
name: Publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pypi-attestations
Comment on lines +39 to +41
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't, it just makes the rendering in the actions status pane slightly prettier 🙂

needs: [build]
permissions:
id-token: write # trusted publishing + attestations

steps:
- name: Download distributions
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
name: distributions
path: dist/

- name: publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true