Skip to content

fix(fit,runtime): guard against all-candidate failures and stale pipe… #8

fix(fit,runtime): guard against all-candidate failures and stale pipe…

fix(fit,runtime): guard against all-candidate failures and stale pipe… #8

Workflow file for this run

name: Release to PyPI
on:
push:
tags:
- "v*.*.*"
jobs:
build-and-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Verify pushed tag matches package version
run: |
tag="${GITHUB_REF_NAME#v}"
version="$(python -c "import re, pathlib; print(re.search(r'__version__\s*=\s*\"([^\"]+)\"', pathlib.Path('src/tracer/__init__.py').read_text()).group(1))")"
echo "tag=$tag package version=$version"
if [ "$tag" != "$version" ]; then
echo "::error::Tag v$tag does not match package version $version (src/tracer/__init__.py). Bump __version__ before tagging."
exit 1
fi
- run: pip install build
- run: python -m build
- uses: pypa/gh-action-pypi-publish@release/v1