Skip to content
Merged
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
36 changes: 33 additions & 3 deletions .github/workflows/build-py-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@ on:
required: false
default: false
type: boolean
push:
branches: ["main"]
paths:
- 'spatialbench-cli/**'
- '.github/workflows/build-py-packages.yml'
pull_request:
paths:
- 'spatialbench-cli/**'
- '.github/workflows/build-py-packages.yml'
workflow_dispatch:
inputs:
upload-artifacts:
description: "Whether to upload built distributions as artifacts"
required: false
default: false
type: boolean

concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
wheels:
Expand Down Expand Up @@ -64,7 +84,7 @@ jobs:
os: windows

# macOS
- runner: macos-13
- runner: macos-14
target: x86_64
os: macos
- runner: macos-14
Expand All @@ -73,6 +93,16 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set ARM architecture flags for Linux cross-compilation
if: (matrix.target == 'aarch64' || matrix.target == 'armv7') && (matrix.os == 'linux' || matrix.os == 'musllinux')
run: |
if [ "${{ matrix.target }}" = "aarch64" ]; then
echo "CFLAGS_aarch64_unknown_linux_gnu=-D__ARM_ARCH=8" >> $GITHUB_ENV
echo "CFLAGS_aarch64_unknown_linux_musl=-D__ARM_ARCH=8" >> $GITHUB_ENV
elif [ "${{ matrix.target }}" = "armv7" ]; then
echo "CFLAGS_armv7_unknown_linux_gnueabihf=-D__ARM_ARCH=7" >> $GITHUB_ENV
echo "CFLAGS_armv7_unknown_linux_musleabihf=-D__ARM_ARCH=7" >> $GITHUB_ENV
fi
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -81,7 +111,7 @@ jobs:
working-directory: spatialbench-cli
manylinux: ${{ matrix.manylinux || '' }}
- name: Upload wheels
if: ${{ inputs.upload-artifacts }}
if: ${{ inputs.upload-artifacts || github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.target }}
Expand All @@ -98,7 +128,7 @@ jobs:
args: --out dist
working-directory: spatialbench-cli
- name: Upload sdist
if: ${{ inputs.upload-artifacts }}
if: ${{ inputs.upload-artifacts || github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
Expand Down