Skip to content

Publish numcodecs-wasm #7

Publish numcodecs-wasm

Publish numcodecs-wasm #7

name: Publish numcodecs-wasm
on:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-22.04
target: x86_64
# - runner: ubuntu-22.04
# target: x86
# - runner: ubuntu-22.04
# target: aarch64
# - runner: ubuntu-22.04
# target: armv7
# - runner: ubuntu-22.04
# target: s390x
# - runner: ubuntu-22.04
# target: ppc64le
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build the wheels
uses: PyO3/maturin-action@v1
with:
working-directory: py/numcodecs-wasm
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: "true"
manylinux: auto
# - name: Build the free-threaded wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist -i python3.13t
# sccache: "true"
# manylinux: auto
- name: Upload the wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
path: py/numcodecs-wasm/dist
# musllinux:
# runs-on: ${{ matrix.platform.runner }}
# strategy:
# matrix:
# platform:
# - runner: ubuntu-22.04
# target: x86_64
# - runner: ubuntu-22.04
# target: x86
# - runner: ubuntu-22.04
# target: aarch64
# - runner: ubuntu-22.04
# target: armv7
# steps:
# - name: Checkout the Repository
# uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: 3.x
# - name: Build the wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist
# sccache: "true"
# manylinux: musllinux_1_2
# # - name: Build the free-threaded wheels
# # uses: PyO3/maturin-action@v1
# # with:
# # working-directory: py/numcodecs-wasm
# # target: ${{ matrix.platform.target }}
# # args: --release --out dist -i python3.13t
# # sccache: "true"
# # manylinux: musllinux_1_2
# - name: Upload the wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-musllinux-${{ matrix.platform.target }}
# path: py/numcodecs-wasm/dist
# windows:
# runs-on: ${{ matrix.platform.runner }}
# strategy:
# matrix:
# platform:
# - runner: windows-latest
# target: x64
# - runner: windows-latest
# target: x86
# steps:
# - name: Checkout the Repository
# uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: 3.x
# - name: Build the wheels
# uses: PyO3/maturin-action@v1
# with:
# working-directory: py/numcodecs-wasm
# target: ${{ matrix.platform.target }}
# args: --release --out dist
# sccache: "true"
# # - name: Build the free-threaded wheels
# # uses: PyO3/maturin-action@v1
# # with:
# # target: ${{ matrix.platform.target }}
# # args: --release --out dist -i python3.13t
# # sccache: "true"
# - name: Upload the wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-windows-${{ matrix.platform.target }}
# path: py/numcodecs-wasm/dist
macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: macos-13
target: x86_64
- runner: macos-14
target: aarch64
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build the wheels
uses: PyO3/maturin-action@v1
with:
working-directory: py/numcodecs-wasm
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: "true"
# - name: Build the free-threaded wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist -i python3.13t
# sccache: "true"
- name: Upload the wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}
path: py/numcodecs-wasm/dist
sdist:
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Build the sdist
uses: PyO3/maturin-action@v1
with:
working-directory: py/numcodecs-wasm
command: sdist
args: --out dist
- name: Upload the sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: py/numcodecs-wasm/dist
PyPi:
name: Publish the sdist and wheels
runs-on: ubuntu-latest
needs: [linux, macos, sdist] # [linux, musllinux, windows, macos, sdist]
environment: publish
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Download the artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist
- name: List the built dist files
run: ls -lh dist/
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: dist/*
- name: Publish the package
uses: pypa/gh-action-pypi-publish@release/v1