Skip to content

Commit

Permalink
update wheel build
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed Sep 3, 2024
1 parent 4179a67 commit a7049f6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 51 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/python-core-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ name: Python wheels (core)

on:
push:
branches:
- main
tags:
- "py-v*"
workflow_dispatch:
Expand Down Expand Up @@ -205,9 +203,9 @@ jobs:
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
wasm-wheels/*.whl
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
# - name: Upload to GitHub Release
# uses: softprops/action-gh-release@v1
# with:
# files: |
# wasm-wheels/*.whl
# prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
71 changes: 28 additions & 43 deletions .github/workflows/python-io-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@ jobs:
pip install geoarrow-rust-io --find-links dist --force-reinstall
python -c "import geoarrow.rust.io"
# Have to set path from root
# https://github.com/actions/upload-artifact/issues/232#issuecomment-964235360
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist/*.whl
name: wheels-linux-${{ matrix.target }}
path: dist

# linux-cross:
# runs-on: ubuntu-latest
Expand Down Expand Up @@ -92,47 +90,40 @@ jobs:
# path: dist/*.whl

macos:
name: Build ${{ matrix.arch }} wheels on ${{ matrix.os }}
name: Build ${{ matrix.platform.target }} wheels on ${{ matrix.platform.runner }}
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-11
arch: x86_64
platform:
- runner: macos-12
target: x86_64
python-version: 3.8
- os: macos-14
arch: arm64
- runner: macos-14
target: aarch64
# Earliest python version on Github for macos arm64
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
python-version: 3.11.3
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: 3.x

- uses: dtolnay/rust-toolchain@stable

- name: Build wheels - ${{ matrix.target }}
- name: Build wheels - ${{ matrix.platform.target }}
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
target: ${{ matrix.platform.target }}
args: --release --out dist -m python/geoarrow-io/Cargo.toml
sccache: "true"

- name: Install built wheel - ${{ matrix.target }}
- name: Install built wheel - ${{ matrix.platform.target }}
run: |
pip install geoarrow-rust-io --find-links dist --force-reinstall
python -c "import geoarrow.rust.io"
# Have to set path from root
# https://github.com/actions/upload-artifact/issues/232#issuecomment-964235360
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-macos-${{ matrix.platform.target }}
path: dist

windows:
Expand Down Expand Up @@ -162,10 +153,10 @@ jobs:
python -c "import geoarrow.rust.io"
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist/*.whl
name: wheels-windows-${{ matrix.target }}
path: dist

# NOTE: musllinux builds are commented out because importing them failed with:
# ImportError: Error loading shared library libgcc_s-60abea67.so.1: No such file or directory
Expand Down Expand Up @@ -254,24 +245,18 @@ jobs:

release:
name: Release
environment:
name: release
url: https://pypi.org/p/geoarrow-rust-io
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [macos, windows, linux]
permissions:
# Used to upload release artifacts
contents: write
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist

- uses: actions/setup-python@v4
- uses: actions/download-artifact@v4
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
python-version: 3.8

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
command: upload
args: --non-interactive --skip-existing wheels-*/*

0 comments on commit a7049f6

Please sign in to comment.