Skip to content

Workflow to publish wheels to PyPI #1

Workflow to publish wheels to PyPI

Workflow to publish wheels to PyPI #1

Workflow file for this run

name: Workflow to publish wheels to PyPI
on:
release:
types:
- released
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout pyse
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install hatch
hatch env create test
- name: Build
run: |
hatch build
- name: Save wheel
uses: actions/upload-artifact@v4
with:
path: dist/*
if-no-files-found: error
retention-days: 7
publish:
# isolate from test, to prevent partial uploads
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Make dist directory
run: mkdir -p dist
- name: Download all wheels
uses: actions/download-artifact@v4
with:
path: dist
- name: Publish to PyPI using trusted publishing
uses: pypa/gh-action-pypi-publish@release/v1
with:
# repository-url: https://test.pypi.org/legacy/
packages-dir: dist/
# skip-existing: true
# verify-metadata: false