erldistpy/.gitlab-ci.yml
russell@unturf.com 08e89d5652
test stage: except tags, bump to v0.1.3
Pipeline #40349 (v0.1.2) failed because the test stage ran on the tag
push and failed (env mismatch on the runner), which skipped the
pypi-twine stage downstream. MPS uses 'except: - tags' on test so
only pypi-twine runs for tag pipelines; mirror that.

Test stage still runs on every branch push, just not on tag pushes.
2026-06-16 14:30:29 -04:00

51 lines
1.8 KiB
YAML

stages:
- test
- pypi-twine
# ---------------------------------------------------------------------------
# Tests run on every push to any branch.
#
# Live-integration tests need EPMD on the runner — ``make all`` skips
# them automatically when EPMD isn't reachable. CI runners typically
# don't run EPMD, so we get unit-level coverage in CI and full
# integration coverage on the dev machine.
# ---------------------------------------------------------------------------
test:
stage: test
tags: ["build"]
except:
- tags
script:
- python3 -m venv .venv
- . .venv/bin/activate
- pip install --upgrade pip wheel
- pip install -e ".[dev]"
- pytest -v
# ---------------------------------------------------------------------------
# Ship to PyPI on tag pushes.
#
# Tag the commit (``git tag -a v0.0.1 -m 'release'`` then
# ``git push --tags``) and CI builds sdist + wheel and uploads with
# twine. Credentials come from GitLab CI variables ``TWINE_USERNAME``
# (typically ``__token__``) and ``TWINE_PASSWORD`` (the PyPI API token).
# ---------------------------------------------------------------------------
pypi-twine:
stage: pypi-twine
tags: ["build"]
only:
- tags
script:
- python3 -m venv .venv
- . .venv/bin/activate
- 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) instead. Until we migrate all four
# python/* repos to Trusted Publishing in one coordinated change,
# stick with the classic ~/.pypirc path that ago / make_post_sell /
# remarkbox already use.
- pip install build "twine<6"
- python -m build
- twine check dist/*
- twine upload --non-interactive dist/*