Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.ref }}
fetch-depth: 0
persist-credentials: false

Expand All @@ -50,11 +51,53 @@ jobs:
- name: Install build tools
run: python -m pip install --upgrade build twine

- name: Verify checked-out tag
env:
PACKAGE_DIR: ${{ needs.select-package.outputs.package }}
run: |
actual_tag="$(git describe --exact-match --tags --match="$PACKAGE_DIR-*")"
if [[ "$actual_tag" != "$GITHUB_REF_NAME" ]]; then
echo "::error::HEAD is tagged as $actual_tag, expected $GITHUB_REF_NAME"
exit 1
fi

- name: Build ${{ needs.select-package.outputs.package }}
env:
PACKAGE_DIR: ${{ needs.select-package.outputs.package }}
run: python -m build --outdir dist "$PACKAGE_DIR"

- name: Verify distribution metadata
env:
EXPECTED_PACKAGE: ${{ needs.select-package.outputs.package }}
EXPECTED_VERSION: ${{ needs.select-package.outputs.version }}
run: |
python - <<'PY'
import email
import os
from pathlib import Path
from zipfile import ZipFile

wheels = list(Path("dist").glob("*.whl"))
if len(wheels) != 1:
raise RuntimeError(f"Expected one wheel, found: {wheels}")

with ZipFile(wheels[0]) as wheel:
metadata_paths = [
path for path in wheel.namelist()
if path.endswith(".dist-info/METADATA")
]
if len(metadata_paths) != 1:
raise RuntimeError(
f"Expected one METADATA file, found: {metadata_paths}"
)
metadata = email.message_from_bytes(wheel.read(metadata_paths[0]))

actual = (metadata["Name"], metadata["Version"])
expected = (os.environ["EXPECTED_PACKAGE"], os.environ["EXPECTED_VERSION"])
if actual != expected:
raise RuntimeError(f"Built {actual}, expected {expected}")
PY

- name: Check distributions
run: python -m twine check dist/*

Expand Down
2 changes: 1 addition & 1 deletion geoarrow-pandas/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
root = ".."
tag_regex = '^geoarrow-pandas-(?P<version>[0-9]+\.[0-9]+\.[0-9]+)$'
git_describe_command = "git describe --long --match='geoarrow-pandas-*'"
git_describe_command = "git describe --long --tags --match='geoarrow-pandas-*'"
version_file = "src/geoarrow/pandas/_version.py"

[tool.pytest.ini_options]
Expand Down
2 changes: 1 addition & 1 deletion geoarrow-pyarrow/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
root = ".."
tag_regex = '^geoarrow-pyarrow-(?P<version>[0-9]+\.[0-9]+\.[0-9]+)$'
git_describe_command = "git describe --long --match='geoarrow-pyarrow-*'"
git_describe_command = "git describe --long --tags --match='geoarrow-pyarrow-*'"
version_file = "src/geoarrow/pyarrow/_version.py"

[tool.pytest.ini_options]
Expand Down
2 changes: 1 addition & 1 deletion geoarrow-types/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
root = ".."
tag_regex = '^geoarrow-types-(?P<version>[0-9]+\.[0-9]+\.[0-9]+)$'
git_describe_command = "git describe --long --match='geoarrow-types-*'"
git_describe_command = "git describe --long --tags --match='geoarrow-types-*'"
version_file = "src/geoarrow/types/_version.py"

[tool.pytest.ini_options]
Expand Down
Loading