Build and publish Python wheel and sdist #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and publish Python wheel and sdist | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
jobs: | |
build: | |
name: Build source distribution and wheel | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install Python 3.11 interpreter | |
run: uv python install 3.11 | |
- name: Install the project | |
run: uv sync --all-extras | |
- name: Build and check | |
run: uv run -m build | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
if-no-files-found: error | |
- name: Publish stable documentation for nnbench | |
uses: ./.github/actions/mike-docs | |
with: | |
version: stable | |
push: true | |
publish_pypi: | |
name: Publish wheels to PyPI | |
needs: [build] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |