From 5c3b6d2e17bb9a6b7363c16e280c5a39cebd89ca Mon Sep 17 00:00:00 2001 From: Connor Ward Date: Fri, 31 Jul 2026 16:04:07 +0100 Subject: [PATCH 1/3] Set up release workflow to match rest of Firedrake --- .github/workflows/release.yml | 80 +++++++++++++++++++++++++++++------ rtree-capi/Cargo.toml | 3 +- 2 files changed, 70 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0a73438..675afac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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: @@ -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 @@ -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: @@ -75,8 +122,10 @@ jobs: pypi: name: Publish to PyPI + needs: [linux_wheel, macos_wheel, sdist] runs-on: ubuntu-latest - needs: [linux, macos, sdist] + # UNDO ME + if: false steps: - name: Download artifacts uses: actions/download-artifact@v7 @@ -92,10 +141,12 @@ jobs: verbose: true password: ${{ secrets.PYPI_API_TOKEN }} - release: - name: Release + github_release: + # UNDO ME + if: false + name: Create GitHub release + needs: pypi runs-on: ubuntu-latest - needs: [linux, macos, sdist] permissions: contents: write steps: @@ -107,7 +158,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/* diff --git a/rtree-capi/Cargo.toml b/rtree-capi/Cargo.toml index 856a5a1..cd55ffc 100644 --- a/rtree-capi/Cargo.toml +++ b/rtree-capi/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "rtree-capi" -version = "2026.2.0" +# TODO RELEASE +version = "2026.3.dev0" edition = "2021" [features] From 5f89c8cad0b937481f3eff8aaebcd82e285b4467 Mon Sep 17 00:00:00 2001 From: Connor Ward Date: Fri, 31 Jul 2026 16:05:55 +0100 Subject: [PATCH 2/3] fixup --- rtree-capi/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtree-capi/Cargo.toml b/rtree-capi/Cargo.toml index cd55ffc..e309fc0 100644 --- a/rtree-capi/Cargo.toml +++ b/rtree-capi/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rtree-capi" # TODO RELEASE -version = "2026.3.dev0" +version = "2026.3.0.dev0" edition = "2021" [features] From 9d35d91c7a61c4ad6eb2fffee8beacab3dc94569 Mon Sep 17 00:00:00 2001 From: Connor Ward Date: Fri, 31 Jul 2026 16:12:49 +0100 Subject: [PATCH 3/3] final fixes --- .github/workflows/release.yml | 4 ---- rtree-capi/Cargo.toml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 675afac..5fab57b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -124,8 +124,6 @@ jobs: name: Publish to PyPI needs: [linux_wheel, macos_wheel, sdist] runs-on: ubuntu-latest - # UNDO ME - if: false steps: - name: Download artifacts uses: actions/download-artifact@v7 @@ -142,8 +140,6 @@ jobs: password: ${{ secrets.PYPI_API_TOKEN }} github_release: - # UNDO ME - if: false name: Create GitHub release needs: pypi runs-on: ubuntu-latest diff --git a/rtree-capi/Cargo.toml b/rtree-capi/Cargo.toml index e309fc0..56c07c1 100644 --- a/rtree-capi/Cargo.toml +++ b/rtree-capi/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rtree-capi" # TODO RELEASE -version = "2026.3.0.dev0" +version = "2026.3.0-dev" edition = "2021" [features]