Skip to content

Update README installation instructions, add PyPI badge / docs link (… #9

Update README installation instructions, add PyPI badge / docs link (…

Update README installation instructions, add PyPI badge / docs link (… #9

Workflow file for this run

# New release tags trigger this workflow to publish to test.pypi.org.
# If that looks good, a `workflow_dispatch` can be used to publish to pypi.org (with `prod-pypi` set to 'true').
name: Publish to PyPI
on:
push:
tags:
- 'v[0-9]+*'
workflow_dispatch:
inputs:
prod-pypi:
type: boolean
description: 'Publish to pypi.org (default: test.pypi.org)'
ref:
description: 'Git ref to checkout, build, and publish'
verbose:
type: boolean
description: 'Enable debug output from pypa/gh-action-pypi-publish'
jobs:
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.ref || '' }}
- uses: actions/setup-python@v5
with:
python-version: '3.11.11'
- name: Build package
run: |
pip install build
python -m build
ls -l dist
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
retention-days: 1
publish:
name: Upload release to ${{ inputs.prod-pypi != true && 'test ' || '' }}PyPI
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://${{ inputs.prod-pypi != true && 'test.' || '' }}pypi.org/p/tiledbsoma_ml # Displayed in GHA UI
permissions:
id-token: write
steps:
- name: Print inputs
run: |
echo "Inputs: ${{ toJSON(github.event.inputs) }}"
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to ${{ inputs.prod-pypi != true && 'test ' || '' }}PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: ${{ inputs.prod-pypi != true && 'https://test.pypi.org/legacy/' || '' }}
verbose: ${{ inputs.verbose }}