Skip to content

Commit b5eb779

Browse files
authored
[MNT] Check versions in wheels workflow (#1948)
From sktime/skpro#583 (review)
1 parent 1956bc8 commit b5eb779

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/pypi_release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,32 @@ on:
55
types: [published]
66

77
jobs:
8+
check_tag:
9+
name: Check tag
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v5
14+
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.11'
18+
19+
- shell: bash
20+
run: |
21+
TAG="${{ github.event.release.tag_name }}"
22+
GH_TAG_NAME="${TAG#v}"
23+
PY_VERSION=$(python - <<'PY'
24+
import pathlib, tomllib
25+
data = tomllib.loads(pathlib.Path("pyproject.toml").read_text(encoding="utf-8"))
26+
print(data.get("project").get("version"))
27+
PY
28+
)
29+
if [ "${GH_TAG_NAME}" != "${PY_VERSION}" ]; then
30+
echo "::error::Tag (${GH_TAG_NAME}) does not match pyproject.toml version (${PY_VERSION})."
31+
exit 2
32+
fi
33+
834
build_wheels:
935
name: Build wheels
1036
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)