Skip to content

Release v0.1.5 from main #2

Release v0.1.5 from main

Release v0.1.5 from main #2

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install release dependencies
run: python -m pip install -e .[release]
- name: Build package
run: python -m build
- name: Check package metadata
run: python -m twine check dist/*
- name: Validate version and release note
shell: bash
run: |
python - <<'PY'
import pathlib
import tomllib
import sys
root = pathlib.Path(".")
sys.path.insert(0, str(root / "src"))
from code2skill import __version__
tag = "${{ github.ref_name }}"
version = tag.removeprefix("v")
pyproject = tomllib.loads((root / "pyproject.toml").read_text(encoding="utf-8"))
declared = pyproject["project"]["version"]
if declared != version:
raise SystemExit(f"Tag {tag} does not match pyproject version {declared}.")
if __version__ != version:
raise SystemExit(f"Tag {tag} does not match runtime version {__version__}.")
release_note = root / "docs" / "releases" / f"v{version}.md"
if not release_note.exists():
raise SystemExit(f"Missing release note file: {release_note}")
PY
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: docs/releases/${{ github.ref_name }}.md