twine 6 (Sep 2025) auto-detects GitLab CI and refuses to fall back to ~/.pypirc, requiring PYPI_ID_TOKEN (Trusted Publishing OIDC). Pin <6 to keep the runner's ~/.pypirc fallback working until we migrate all python/* repos to Trusted Publishing as a coordinated change.
29 lines
688 B
YAML
29 lines
688 B
YAML
stages:
|
|
- test
|
|
- pypi-twine
|
|
|
|
test:
|
|
stage: test
|
|
tags: ["build"]
|
|
script: make test
|
|
artifacts:
|
|
paths:
|
|
- env.vanilla
|
|
expire_in: 1 hour
|
|
|
|
pypi-twine:
|
|
stage: pypi-twine
|
|
tags:
|
|
- build
|
|
only:
|
|
- tags
|
|
script:
|
|
- pip install --upgrade pip
|
|
# Pin twine <6 — newer twine auto-detects GitLab CI and refuses to
|
|
# fall back to ~/.pypirc on the runner, requiring PYPI_ID_TOKEN
|
|
# (Trusted Publishing OIDC). Until we migrate to Trusted Publishing,
|
|
# stick with the classic ~/.pypirc auth on the build runner.
|
|
- pip install "twine<6"
|
|
- python3 setup.py sdist bdist_wheel
|
|
- twine check dist/*
|
|
- twine upload --non-interactive dist/*
|