Skip to content

PyPI

PyPI #8

Workflow file for this run

name: PyPI
on:
workflow_dispatch:
inputs:
publish_to_pypi:
description: 'Publish to PyPI?'
required: true
type: string
default: 'false'
jobs:
dist:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.10" ]
steps:
- name: Checkout pyfolio
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build wheels
run: pipx run build
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
path: dist/*
- name: Check metadata
run: pipx run twine check dist/*
upload_pypi:
needs: [ dist ]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: publish to testpypi
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ inputs.publish_to_pypi == 'false' }}
with:
user: __token__
password: ${{ secrets.TESTPYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: publish to pypi
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ inputs.publish_to_pypi == 'true' }}
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}