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
76 changes: 64 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,64 @@
name: Publish release

on:
release:
types: [published]
workflow_dispatch:
inputs:
branch:
description: The branch to release from
type: string
required: true
version:
description: The version number to release
type: string
required: true
prev_version:
description: The previously most up-to-date version number
type: string
required: true

permissions:
contents: read

jobs:
linux:
check:
name: Pre-release checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.branch }}

- name: Check no 'TODO RELEASE' comments remain
run: |
if [ -z "$( grep -r --exclude-dir='.*' 'TODO RELEASE' )" ]; then
exit 0
else
exit 1
fi

- name: Check version number matches
run: |
if [ -z "$( grep 'version = \"${{ inputs.version }}\"' rtree-capi/Cargo.toml )" ]; then
exit 1
else
exit 0
fi

linux_wheel:
name: Create Linux wheels
needs: check
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-22.04
- runner: ubuntu-24.04
target: x86_64
- runner: ubuntu-22.04
- runner: ubuntu-24.04
target: aarch64
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.branch }}
- uses: actions/setup-python@v6
with:
python-version: 3.x
Expand All @@ -35,7 +74,9 @@ jobs:
name: wheels-linux-${{ matrix.platform.target }}
path: dist

macos:
macos_wheel:
name: Create macOS wheels
needs: check
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
Expand All @@ -46,6 +87,8 @@ jobs:
target: aarch64
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.branch }}
- uses: actions/setup-python@v6
with:
python-version: 3.x
Expand All @@ -60,9 +103,13 @@ jobs:
path: dist

sdist:
name: Create sdist
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.branch }}
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
Expand All @@ -75,8 +122,8 @@ jobs:

pypi:
name: Publish to PyPI
needs: [linux_wheel, macos_wheel, sdist]
runs-on: ubuntu-latest
needs: [linux, macos, sdist]
steps:
- name: Download artifacts
uses: actions/download-artifact@v7
Expand All @@ -92,10 +139,10 @@ jobs:
verbose: true
password: ${{ secrets.PYPI_API_TOKEN }}

release:
name: Release
github_release:
name: Create GitHub release
needs: pypi
runs-on: ubuntu-latest
needs: [linux, macos, sdist]
permissions:
contents: write
steps:
Expand All @@ -107,7 +154,12 @@ jobs:
merge-multiple: true
path: dist/

- name: Upload to GitHub release
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload ${{ github.event.release.tag_name }} dist/*
run: gh release create \
--title ${{ inputs.version }} \
--target ${{ inputs.branch }} \
--generate-notes ${{ inputs.version }} \
--notes-start-tag ${{ inputs.prev_version }} \
dist/*
3 changes: 2 additions & 1 deletion rtree-capi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "rtree-capi"
version = "2026.2.0"
# TODO RELEASE
version = "2026.3.0-dev"
edition = "2021"

[features]
Expand Down
Loading