infrasynth-backend-kit/.forgejo/workflows/publish.yml
jcv-dev ef95250b7d
All checks were successful
CI / Tests (push) Successful in 59s
CI / Lint (push) Successful in 10s
CI / Type Check (push) Successful in 47s
chore(ci): use uv for Python 3.12 (arm64) instead of actions/setup-python
2026-09-29 18:37:09 -05:00

45 lines
1.3 KiB
YAML

name: Publish
# Publishes the package to the Forgejo package registry (PyPI-compatible).
# Trigger by pushing an annotated tag, e.g.: git tag v1.0.1 && git push origin main --tags
#
# Required repository secrets (Settings → Actions → Secrets):
# FORGEJO_USERNAME your Forgejo username (e.g. moravak)
# FORGEJO_TOKEN an access token with the `write:package` scope
#
# Uses `uv` for Python 3.12 (arm64-friendly); no actions/setup-python needed.
on:
push:
tags: ["v*"]
workflow_dispatch:
permissions:
contents: read
env:
# Forgejo's PyPI registry is /api/packages/<owner>/pypi
REGISTRY_URL: https://git.infrasynth.net/api/packages/moravak/pypi
jobs:
publish:
name: Build & publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Build sdist + wheel
run: |
"$HOME/.local/bin/uv" venv --python 3.12
"$HOME/.local/bin/uv" pip install build twine
.venv/bin/python -m build
- name: Publish to Forgejo PyPI registry
env:
TWINE_USERNAME: ${{ secrets.FORGEJO_USERNAME }}
TWINE_PASSWORD: ${{ secrets.FORGEJO_TOKEN }}
run: |
.venv/bin/twine upload --non-interactive --repository-url "$REGISTRY_URL" dist/*