kalente/.forgejo/workflows/release.yml
Kumi a8d1a8b4c3
feat(ci/cd): Transition CI/CD to Forgejo for PyPI publishing
Migrated the CI/CD pipeline for PyPI package publishing from GitLab CI to Forgejo workflows. This change introduces a new `release.yml` workflow in the `.forgejo/workflows` directory, designed to trigger on tagged commits with a version identifier. The new workflow uses a Node.js container to manage the Python environment setup and package publication. By switching to Forgejo, we aim to consolidate CI/CD processes and improve integration within our development workflow.

This migration removes the previous `.gitlab-ci.yml` file, reflecting a shift away from GitLab CI in our project infrastructure.
2024-05-28 12:25:22 +02:00

32 lines
697 B
YAML

name: Python Package CI/CD
on:
workflow_dispatch:
push:
tags:
- "v*"
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 hatchling twine build
python -m build .
python -m twine upload --username __token__ --password ${PYPI_TOKEN} dist/*
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}