Skip to content

feat!: spec sync 3.22.0 → 3.23.0 (v6.0.0) — drop multivariate lookup-… #21

feat!: spec sync 3.22.0 → 3.23.0 (v6.0.0) — drop multivariate lookup-…

feat!: spec sync 3.22.0 → 3.23.0 (v6.0.0) — drop multivariate lookup-… #21

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
jobs:
build:
name: Build sdist and wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
- name: Set up Python
run: uv python install 3.12
- name: Verify tag matches pyproject version
run: |
TAG="${GITHUB_REF#refs/tags/v}"
PROJECT_VERSION="$(uv run python -c 'import tomllib,sys;print(tomllib.loads(open("pyproject.toml","rb").read().decode())["project"]["version"])')"
if [ "$TAG" != "$PROJECT_VERSION" ]; then
echo "::error::Git tag v$TAG does not match pyproject.toml version $PROJECT_VERSION"
exit 1
fi
- name: Build
run: uv build
- name: Check artifacts
run: uv run --with twine twine check dist/*
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dist
path: dist/
publish-pypi:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/kalshi-sdk/
permissions:
id-token: write # required for PyPI trusted publishing + attestations (OIDC)
attestations: write # required to upload sigstore attestations
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
attestations: true
github-release:
name: Create GitHub Release
needs: publish-pypi
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0 # full history so we can extract the tag's CHANGELOG section
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist/
- name: Extract release notes from CHANGELOG
id: notes
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
# Pull the section between this version's heading and the next ## heading.
# Tolerates both "## 1.0.0 — date" and "## [1.0.0] - date" formats.
awk -v v="$VERSION" '
$0 ~ "^## \\[?"v"\\]?( |$)" {flag=1; next}
flag && /^## / {exit}
flag {print}
' CHANGELOG.md > release_notes.md
if [ ! -s release_notes.md ]; then
echo "::warning::No CHANGELOG section found for v$VERSION; using a stub"
echo "Release v$VERSION" > release_notes.md
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
with:
files: dist/*
body_path: release_notes.md
draft: false
prerelease: ${{ contains(github.ref, '-') }}