Skip to content

[pre-commit.ci] pre-commit autoupdate #7

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #7

Workflow file for this run

name: PyPI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- "trunk-*"
tags:
- "v*"
workflow_dispatch:
jobs:
build_wheel:
name: Build wheel
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.12
- name: Set up Python environment
uses: glotzerlab/workflows/setup-uv@5cfac9da9cb78e16ae97a9119b6fd13c1c2d6f5e # 0.1.0
with:
lockfile: ".github/workflows/requirements-build.txt"
- name: Build wheel
run: python3 -m build --outdir dist/ .
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: dist
path: dist
upload_pypi:
name: Publish [PyPI]
needs: [build_wheel]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
merge-multiple: 'true'
pattern: dist
path: dist
- name: Check files
run: ls -lR dist
- name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0