Skip to content

fix: update repo URLs to logtide-dev/logtide-python #1

fix: update repo URLs to logtide-dev/logtide-python

fix: update repo URLs to logtide-dev/logtide-python #1

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
# ── 1. Run tests before publishing ────────────────────────────────────────
test:
name: Test before release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install dependencies
run: pip install -e ".[dev,async]"
- name: Run tests
run: pytest tests/ -v --tb=short
# ── 2. Build source distribution and wheel ────────────────────────────────
build:
name: Build distribution
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install build
run: pip install build
- name: Build sdist and wheel
run: python -m build
- name: Verify tag matches package version
run: |
TAG="${GITHUB_REF_NAME#v}"
VERSION=$(python -c "import logtide_sdk; print(logtide_sdk.__version__)")
if [ "$TAG" != "$VERSION" ]; then
echo "ERROR: tag '$TAG' does not match package version '$VERSION'"
exit 1
fi
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
# ── 3. Publish to PyPI via OIDC Trusted Publisher ─────────────────────────
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: build
environment: pypi
permissions:
id-token: write # required for OIDC trusted publisher
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1