Files
python-repositories/.gitea/workflows/publish.yml
T
Brian Bjarke Jensen c789e33290
Code Quality Pipeline / code-quality (push) Failing after 1m49s
Test Python Package / test (push) Failing after 16s
Dependency Update Bot / update-check (push) Failing after 2m4s
Security Audit / safety (push) Failing after 1m26s
initial commit
2025-08-31 17:50:04 +02:00

43 lines
1.0 KiB
YAML

# Gitea Actions workflow to build and publish Python package to Gitea Package Registry
name: Publish Python Package
on:
push:
tags:
- "v*.*.*"
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.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 sync --no-dev
uv build
- name: Publish to Gitea Package Registry
env:
UV_PUBLISH_TOKEN: ${{ secrets.CI_RUNNER_TOKEN }}
UV_PUBLISH_URL: ${{ vars.REPOSITORY_URL }}
run: |
uv publish