Files
python-utils/.gitea/workflows/publish.yml
T
Brian Bjarke Jensen cb036da997
Code Quality Pipeline / Setup Python and UV dependencies (pull_request) Successful in 17s
Code Quality Pipeline / code-quality (pull_request) Failing after 4s
Test Python Package / Setup Python and UV dependencies (pull_request) Successful in 18s
Test Python Package / test (pull_request) Failing after 3s
Type Check / Setup Python and UV dependencies (pull_request) Successful in 17s
Type Check / type-check (pull_request) Failing after 4s
fixed using reusable workflows
2025-08-28 20:25:21 +02:00

48 lines
1.2 KiB
YAML

# Gitea Actions workflow to build and publish Python package to Gitea Package Registry
name: Publish Python Package
on:
push:
tags:
- "v*.*.*"
jobs:
setup-python:
name: Setup Python
uses: ./.gitea/workflows/setup-python.yml
with:
python-version: ${{ vars.PYTHON_VERSION }}
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: ./.gitea/workflows/setup-python.yml
with:
python-version: ${{ vars.PYTHON_VERSION }}
- name: Install uv
run: pip install uv
- name: Update version in pyproject.toml to match tag
run: |
TAG_VERSION="${GITHUB_REF##*/}"
VERSION="${TAG_VERSION#v}"
sed -i.bak -E "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml
rm pyproject.toml.bak
- name: Build package
run: |
uv pip install build --system
uv build
- name: Publish to Gitea Package Registry
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.CI_RUNNER_TOKEN }}
TWINE_REPOSITORY_URL: ${{ vars.REPOSITORY_URL }}
run: |
uv pip install twine --system
twine upload dist/*