Skip to content

Commit

Permalink
release: split jobs, refactor (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
woodruffw authored Oct 3, 2024
1 parent 5b36c55 commit ec259d7
Showing 1 changed file with 41 additions and 20 deletions.
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
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

0 comments on commit ec259d7

Please sign in to comment.