Install python3-pip via apt so twine publish works on the default ubuntu-latest container image (same substrate fix as kaizen-agentic).
48 lines
1.5 KiB
YAML
48 lines
1.5 KiB
YAML
# Publish issue-core to Forgejo org PyPI on version tags.
|
|
# Runner substrate: ubuntu-latest → node:20-bookworm — install pip via apt.
|
|
# Org secrets required: FORGEJO_PYPI_USER, FORGEJO_PYPI_TOKEN.
|
|
name: Publish Python package
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Fetch source archive
|
|
env:
|
|
REF: ${{ github.sha }}
|
|
run: |
|
|
set -eu
|
|
mkdir -p buildctx
|
|
SHORT="${REF:0:7}"
|
|
wget -qO /tmp/repo.tar.gz \
|
|
"https://forgejo.coulomb.social/${GITHUB_REPOSITORY}/archive/${SHORT}.tar.gz"
|
|
tar xzf /tmp/repo.tar.gz -C buildctx --strip-components=1
|
|
|
|
- name: Install Python tooling
|
|
run: |
|
|
set -eu
|
|
apt-get update -qq
|
|
apt-get install -y -qq python3 python3-pip python3-venv >/dev/null
|
|
python3 -m pip install --break-system-packages --upgrade pip build twine
|
|
|
|
- name: Build and validate distributions
|
|
working-directory: buildctx
|
|
run: |
|
|
python3 -m build
|
|
python3 -m twine check dist/*
|
|
|
|
- name: Upload to Forgejo PyPI
|
|
working-directory: buildctx
|
|
env:
|
|
TWINE_USERNAME: ${{ secrets.FORGEJO_PYPI_USER }}
|
|
TWINE_PASSWORD: ${{ secrets.FORGEJO_PYPI_TOKEN }}
|
|
run: >-
|
|
python3 -m twine upload
|
|
--repository-url https://forgejo.coulomb.social/api/packages/coulomb/pypi
|
|
dist/*
|