Skip to content

Build wheels

Build wheels #125

name: Build wheels
on:
# Run daily at 1:23 UTC
schedule:
- cron: '23 1 * * *'
# Run on demand with workflow dispatch
workflow_dispatch:
# Use from other workflows
workflow_call:
permissions:
contents: read
concurrency:
group: build-wheels-${{ github.ref }}
cancel-in-progress: true
jobs:
determine-source-date-epoch:
name: "Determine SOURCE_DATE_EPOCH"
if: github.event_name != 'schedule' || github.repository_owner == 'scikit-hep'
runs-on: ubuntu-latest
outputs:
source-date-epoch: ${{ steps.log.outputs.source-date-epoch }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true
fetch-depth: 0
persist-credentials: false
- id: log
name: Compute SOURCE_DATE_EPOCH
run: |
# Find latest unix timestamp in awkward-cpp, and the kernel generation files
epoch=$( git log -1 --format=%at -- awkward-cpp kernel-specification.yml kernel-test-data.json )
echo "source-date-epoch=$epoch" >> $GITHUB_OUTPUT
make_sdist:
name: "Build awkward-cpp sdist"
if: github.event_name != 'schedule' || github.repository_owner == 'scikit-hep'
runs-on: ubuntu-latest
needs: [determine-source-date-epoch]
env:
SOURCE_DATE_EPOCH: ${{ needs.determine-source-date-epoch.outputs.source-date-epoch }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true
persist-credentials: false
- name: Prepare build files
run: pipx run nox -s prepare
- name: Build awkward-cpp sdist
run: pipx run build --sdist awkward-cpp
- name: Check metadata
run: pipx run twine check awkward-cpp/dist/*
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: awkward-cpp-sdist
path: awkward-cpp/dist/*.tar.gz
build_wheels:
needs: [determine-source-date-epoch]
name: "Wheel awkward-cpp: ${{ matrix.arch }} on ${{ matrix.os }}"
if: github.event_name != 'schedule' || github.repository_owner == 'scikit-hep'
runs-on: ${{ matrix.os }}
env:
SOURCE_DATE_EPOCH: ${{ needs.determine-source-date-epoch.outputs.source-date-epoch }}
strategy:
matrix:
os: [ubuntu-latest, macos-15, macos-15-intel]
arch: [auto64]
include:
- os: windows-latest
arch: auto64
- os: windows-latest
arch: auto32
- os: ubuntu-24.04-arm
arch: auto64
- os: windows-11-arm
arch: auto64
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true
persist-credentials: false
- name: Python 3.12
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- name: Setup uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Prepare build files
run: pipx run nox -s prepare
- uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1
env:
CIBW_ARCHS: ${{ matrix.arch }}
with:
package-dir: awkward-cpp
- name: Check metadata
run: pipx run twine check wheelhouse/*.whl
- name: Upload wheels
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: awkward-cpp-wheels-${{ matrix.os }}-${{ matrix.arch }}
path: wheelhouse/*.whl
build_pyodide_wheels:
needs: [determine-source-date-epoch]
name: "Wheel awkward-cpp: pyodide"
if: github.event_name != 'schedule' || github.repository_owner == 'scikit-hep'
runs-on: ubuntu-latest
env:
SOURCE_DATE_EPOCH: ${{ needs.determine-source-date-epoch.outputs.source-date-epoch }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true
persist-credentials: false
- name: Setup uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Prepare build files
run: pipx run nox -s prepare
- uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1
env:
CIBW_PLATFORM: pyodide
with:
package-dir: awkward-cpp
- name: Check metadata
run: pipx run twine check wheelhouse/*.whl
- name: Upload wheels
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: awkward-cpp-wheels-pyodide
path: wheelhouse/*.whl
build_awkward_wheel:
name: "Build awkward sdist and wheel"
if: github.event_name != 'schedule' || github.repository_owner == 'scikit-hep'
runs-on: ubuntu-latest
needs: [determine-source-date-epoch]
env:
SOURCE_DATE_EPOCH: ${{ needs.determine-source-date-epoch.outputs.source-date-epoch }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true
persist-credentials: false
- name: Setup uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Prepare build files
run: pipx run nox -s prepare
- name: Build distributions
run: uvx --from build pyproject-build --installer uv
- name: Check metadata
run: pipx run twine check dist/*
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: awkward-wheel
path: dist/*