Skip to content

Initial commit: siftfy 0.1.0 #1

Initial commit: siftfy 0.1.0

Initial commit: siftfy 0.1.0 #1

Workflow file for this run

name: Publish to PyPI
# Trigger on a tag like v0.1.0. The workflow verifies that the tag matches
# the version declared in src/siftfy/_version.py before publishing, so we can
# never ship a tag that's out of sync with the package metadata.
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # PyPI trusted publishing (no API token needed)
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Verify tag matches package version
run: |
TAG="${GITHUB_REF_NAME#v}"
PKG_VERSION=$(python -c "import re,pathlib;print(re.search(r'\"([^\"]+)\"', pathlib.Path('src/siftfy/_version.py').read_text()).group(1))")
if [ "$TAG" != "$PKG_VERSION" ]; then
echo "tag $GITHUB_REF_NAME ($TAG) does not match _version.py ($PKG_VERSION)" >&2
exit 1
fi
- name: Install build tooling
run: |
python -m pip install --upgrade pip
pip install build
- name: Build sdist + wheel
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1