diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f291a86..25510ba 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,6 +22,19 @@ jobs: with: enable-cache: true + # A release tag whose version was never bumped in pyproject.toml only + # surfaces at upload time, as an opaque PyPI "400 File already exists". + # Fail here instead, before the tests even run. + - name: Check the release tag matches the package version + if: github.event_name == 'release' + run: | + tag="${GITHUB_REF_NAME#v}" + packaged="$(uv version --short)" + if [ "$tag" != "$packaged" ]; then + echo "::error::Release tag v$tag does not match pyproject.toml version $packaged — bump the version, merge, then re-tag." + exit 1 + fi + - name: Test (gate the release) run: uv run --group dev pytest -q diff --git a/pyproject.toml b/pyproject.toml index 12d35bf..b6e7f3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lokf" -version = "0.2.0" +version = "0.3.0" description = "Linked Open Knowledge Format (LOKF) — a semantic profile of Google's Open Knowledge Format, defined once in LinkML" readme = "README.md" license = "CC-BY-4.0" diff --git a/uv.lock b/uv.lock index c049c52..3d85c8e 100644 --- a/uv.lock +++ b/uv.lock @@ -833,7 +833,7 @@ wheels = [ [[package]] name = "lokf" -version = "0.2.0" +version = "0.3.0" source = { editable = "." } dependencies = [ { name = "linkml-runtime" },