60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
name: Publish to PyPI
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build:
|
|
name: Build distributions
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Install build tools
|
|
run: python -m pip install --upgrade build twine
|
|
|
|
- name: Build wheel and source distribution
|
|
run: python -m build
|
|
|
|
- name: Validate distributions
|
|
run: python -m twine check dist/*
|
|
|
|
- name: Upload distributions
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: python-package-distributions
|
|
path: dist/
|
|
if-no-files-found: error
|
|
|
|
publish:
|
|
name: Publish distributions to PyPI
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: pypi
|
|
url: https://pypi.org/p/micromesh
|
|
permissions:
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Download distributions
|
|
uses: actions/download-artifact@v6
|
|
with:
|
|
name: python-package-distributions
|
|
path: dist/
|
|
|
|
- name: Publish distributions
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|