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
90 changes: 90 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: release

on:
push:
tags:
- "geoarrow-types-*"
- "geoarrow-pyarrow-*"
- "geoarrow-pandas-*"

permissions:
contents: read

jobs:
select-package:
runs-on: ubuntu-latest

outputs:
package: ${{ steps.tag.outputs.package }}
version: ${{ steps.tag.outputs.version }}

steps:
- name: Validate release tag
id: tag
shell: bash
run: |
tag="${GITHUB_REF_NAME}"

if [[ ! "$tag" =~ ^(geoarrow-types|geoarrow-pyarrow|geoarrow-pandas)-([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
echo "::error::Invalid release tag: $tag"
exit 1
fi

echo "package=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
echo "version=${BASH_REMATCH[2]}" >> "$GITHUB_OUTPUT"

build:
needs: select-package
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-python@v7
with:
python-version: "3.14"

- name: Install build tools
run: python -m pip install --upgrade build twine

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

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

- name: Upload distributions
uses: actions/upload-artifact@v7
with:
name: python-package-distributions
path: dist/
if-no-files-found: error

publish:
needs:
- select-package
- build

runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/${{ needs.select-package.outputs.package }}

permissions:
id-token: write

steps:
- name: Download distributions
uses: actions/download-artifact@v8
with:
name: python-package-distributions
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion geoarrow-pandas/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
root = ".."
tag_regex = "geoarrow-pandas-([0-9.]+)"
tag_regex = '^geoarrow-pandas-(?P<version>[0-9]+\.[0-9]+\.[0-9]+)$'
git_describe_command = "git describe --long --match='geoarrow-pandas-*'"
version_file = "src/geoarrow/pandas/_version.py"

Expand Down
2 changes: 1 addition & 1 deletion geoarrow-pyarrow/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
root = ".."
tag_regex = "geoarrow-pyarrow-([0-9]+.[0-9]+.[0-9]+)"
tag_regex = '^geoarrow-pyarrow-(?P<version>[0-9]+\.[0-9]+\.[0-9]+)$'
git_describe_command = "git describe --long --match='geoarrow-pyarrow-*'"
version_file = "src/geoarrow/pyarrow/_version.py"

Expand Down
2 changes: 1 addition & 1 deletion geoarrow-types/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
root = ".."
tag_regex = "geoarrow-types-([0-9.]+)"
tag_regex = '^geoarrow-types-(?P<version>[0-9]+\.[0-9]+\.[0-9]+)$'
git_describe_command = "git describe --long --match='geoarrow-types-*'"
version_file = "src/geoarrow/types/_version.py"

Expand Down
Loading