Skip to content

Upload release to PyPI #4

Upload release to PyPI

Upload release to PyPI #4

Workflow file for this run

name: Upload release to PyPI
on:
workflow_dispatch:
inputs:
version:
description: 'Version tag for the Docker image'
required: true
push:
tags:
- 'v*.*.*'
jobs:
pypi-publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update version in toml
env:
VERSION: ${{ github.event.inputs.version || github.ref_name }}
run: |
echo $VERSION
sed -i "s/^version = .*/version = \"$VERSION\"/" pyproject.toml
- name: Install pypa/build
run: python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/