feat: add CI/CD workflow for PyPI package releases
All checks were successful
Python Package CI/CD / Publish to PyPI (push) Successful in 36s

Introduced a GitHub Actions workflow for automated CI/CD of the Python package. This setup includes:
- Triggering on push events to any tag
- Containerized build environment using Node 20 on Bookworm
- Steps for code checkout, dependency installation, and publishing to PyPI

This enhancement streamlines the release process and ensures consistent packaging and distribution of the Python package.
This commit is contained in:
Kumi 2024-06-19 09:37:22 +02:00
parent d15b0a53dc
commit d5fc940e60
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -0,0 +1,32 @@
name: Python Package CI/CD
on:
workflow_dispatch:
push:
tags:
- "*"
jobs:
publish:
name: Publish to PyPI
container:
image: node:20-bookworm
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt update
apt install -y python3 python3-venv
- name: Publish to PyPI
run: |
python3 -m venv venv
. ./venv/bin/activate
pip install -U twine build
python -m build .
python -m twine upload --username __token__ --password ${PYPI_TOKEN} dist/*
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}