Skip to content

Compatibility and build misc #617

Compatibility and build misc

Compatibility and build misc #617

Workflow file for this run

name: artifact
on: push
env:
FORCE_COLOR: "1"
PIP_DISABLE_PIP_VERSION_CHECK: "1"
RUST_TOOLCHAIN: "nightly-2025-10-21"
RUST_TOOLCHAIN_STABLE: "1.85"
UNSAFE_PYO3_BUILD_FREE_THREADED: "1"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
UV_LINK_MODE: "copy"
jobs:
sdist:
runs-on: ubuntu-24.04
timeout-minutes: 10
strategy:
fail-fast: false
steps:
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: rustup stable
run: |
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain "${RUST_TOOLCHAIN_STABLE}" -y
rustup default "${RUST_TOOLCHAIN_STABLE}"
- uses: actions/checkout@v5
- name: Cargo.toml and pyproject.toml version must match
run: ./script/check-version
- run: python3 -m pip install --user --upgrade pip "maturin>=1,<2" wheel
- name: Vendor dependencies
run: |
maturin build
cargo fetch
mkdir .cargo
cp ci/sdist.toml .cargo/config.toml
cargo vendor include/cargo --versioned-dirs
- run: maturin sdist --out=dist
- run: python3 -m pip install --user dist/orjson*.tar.gz
env:
CARGO_NET_OFFLINE: "true"
- run: python3 -m pip install --user -r test/requirements.txt -r integration/requirements.txt mypy
- run: pytest -v test
env:
PYTHONMALLOC: "debug"
- run: ./integration/run thread
- run: ./integration/run http
- run: ./integration/run init
- run: ./integration/run typestubs
- name: Store sdist
uses: actions/upload-artifact@v4
with:
name: orjson_sdist
path: dist
overwrite: true
retention-days: 1
if-no-files-found: "error"
compression-level: 0
manylinux_amd64:
runs-on: ubuntu-24.04
container:
image: fedora:rawhide
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: [
{ interpreter: 'python3.14t', compatibility: "manylinux_2_34", publish: false },
{ interpreter: 'python3.14', compatibility: "manylinux_2_17", publish: true },
{ interpreter: 'python3.13', compatibility: "manylinux_2_17", publish: true },
{ interpreter: 'python3.12', compatibility: "manylinux_2_17", publish: true },
{ interpreter: 'python3.11', compatibility: "manylinux_2_17", publish: true },
{ interpreter: 'python3.10', compatibility: "manylinux_2_17", publish: true },
{ interpreter: 'python3.9', compatibility: "manylinux_2_17", publish: true },
]
env:
CARGO_TARGET_DIR: "/tmp/orjson"
CC: "clang"
CFLAGS: "-O2 -fstrict-aliasing -fno-plt -emit-llvm"
LDFLAGS: "-fuse-ld=lld -Wl,-plugin-opt=also-emit-llvm -Wl,--as-needed -Wl,-zrelro,-znow"
RUSTFLAGS: "-Z unstable-options -C panic=immediate-abort -C linker=clang -C link-arg=-fuse-ld=lld -C linker-plugin-lto -C link-arg=-Wl,-zrelro,-znow -Z mir-opt-level=4 -Z threads=4 -D warnings"
VENV: ".venv"
steps:
- name: CPU info
run: cat /proc/cpuinfo
- run: dnf install --setopt=install_weak_deps=false -y git
- uses: actions/checkout@v5
- name: Build and test
uses: ./.github/actions/manylinux
with:
arch: "x86_64"
interpreter: "${{ matrix.python.interpreter }}"
features: "avx512"
compatibility: "${{ matrix.python.compatibility }}"
publish: "${{ matrix.python.publish }}"
- name: Store wheels
if: matrix.python.publish == true
uses: actions/upload-artifact@v4
with:
name: "orjson_manylinux_amd64_${{ matrix.python.interpreter }}_${{ matrix.python.compatibility }}"
path: dist
overwrite: true
retention-days: 1
- name: Debug
env:
CARGO_TARGET_DIR: "/tmp/orjson"
ORJSON_FEATURES: "avx512"
PYTHON: "${{ matrix.python.interpreter }}"
TARGET: "x86_64-unknown-linux-gnu"
run: |
export PATH="$PWD/.venv:$HOME/.cargo/bin:$PATH"
source .venv/bin/activate
script/debug
manylinux_aarch64:
runs-on: ubuntu-24.04-arm
container:
image: fedora:rawhide
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: [
{ interpreter: 'python3.14t', compatibility: "manylinux_2_34", publish: false },
{ interpreter: 'python3.14', compatibility: "manylinux_2_17", publish: true },
{ interpreter: 'python3.13', compatibility: "manylinux_2_17", publish: true },
{ interpreter: 'python3.12', compatibility: "manylinux_2_17", publish: true },
{ interpreter: 'python3.11', compatibility: "manylinux_2_17", publish: true },
{ interpreter: 'python3.10', compatibility: "manylinux_2_17", publish: true },
{ interpreter: 'python3.9', compatibility: "manylinux_2_17", publish: true },
]
env:
CARGO_TARGET_DIR: "/tmp/orjson"
CC: "clang"
CFLAGS: "-O2 -fstrict-aliasing -fno-plt -emit-llvm"
LDFLAGS: "-fuse-ld=lld -Wl,-plugin-opt=also-emit-llvm -Wl,--as-needed -Wl,-zrelro,-znow"
RUSTFLAGS: "-Z unstable-options -C panic=immediate-abort -C linker=clang -C link-arg=-fuse-ld=lld -C linker-plugin-lto -C link-arg=-Wl,-zrelro,-znow -Z mir-opt-level=4 -Z threads=4 -D warnings"
VENV: ".venv"
steps:
- name: CPU info
run: cat /proc/cpuinfo
- run: dnf install --setopt=install_weak_deps=false -y git
- uses: actions/checkout@v5
- name: Build and test
uses: ./.github/actions/manylinux
with:
arch: "aarch64"
interpreter: "${{ matrix.python.interpreter }}"
features: "generic_simd"
compatibility: "${{ matrix.python.compatibility }}"
publish: "${{ matrix.python.publish }}"
- name: Store wheels
if: matrix.python.publish == true
uses: actions/upload-artifact@v4
with:
name: "orjson_manylinux_aarch64_${{ matrix.python.interpreter }}_${{ matrix.python.compatibility }}"
path: dist
overwrite: true
retention-days: 1
- name: Debug
env:
CARGO_TARGET_DIR: "/tmp/orjson"
ORJSON_FEATURES: "generic_simd"
PYTHON: "${{ matrix.python.interpreter }}"
TARGET: "aarch64-unknown-linux-gnu"
run: |
export PATH="$PWD/.venv:$HOME/.cargo/bin:$PATH"
source .venv/bin/activate
script/debug
manylinux_cross:
runs-on: ubuntu-24.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: [
{ interpreter: 'python3.14', abi: 'cp314-cp314', manylinux: 'manylinux_2_17', publish: true },
{ interpreter: 'python3.13', abi: 'cp313-cp313', manylinux: 'manylinux_2_17', publish: true },
{ interpreter: 'python3.12', abi: 'cp312-cp312', manylinux: 'manylinux_2_17', publish: true },
{ interpreter: 'python3.11', abi: 'cp311-cp311', manylinux: 'manylinux_2_17', publish: true },
{ interpreter: 'python3.10', abi: 'cp310-cp310', manylinux: 'manylinux_2_17', publish: true },
{ interpreter: 'python3.9', abi: 'cp39-cp39', manylinux: 'manylinux_2_17', publish: true },
]
target: [
{
arch: 'i686',
cflags: '-Os -fstrict-aliasing',
features: '',
rustflags: '-Z unstable-options -C panic=immediate-abort -Z mir-opt-level=4 -D warnings',
target: 'i686-unknown-linux-gnu',
},
{
arch: 'armv7',
cflags: '-Os -fstrict-aliasing',
features: '',
rustflags: '-Z unstable-options -C panic=immediate-abort -Z mir-opt-level=4 -D warnings -C opt-level=s',
target: 'armv7-unknown-linux-gnueabihf',
},
{
arch: 'ppc64le',
cflags: '-Os -fstrict-aliasing',
features: 'generic_simd',
rustflags: '-Z unstable-options -C panic=immediate-abort -Z mir-opt-level=4 -D warnings',
target: 'powerpc64le-unknown-linux-gnu',
},
{
arch: 's390x',
cflags: '-Os -fstrict-aliasing -march=z10',
features: '',
rustflags: '-Z unstable-options -C panic=immediate-abort -Z mir-opt-level=4 -D warnings -C target-cpu=z10',
target: 's390x-unknown-linux-gnu',
},
]
steps:
- uses: actions/checkout@v5
- name: build-std
run: |
mkdir .cargo
cp ci/config.toml .cargo/config.toml
- name: Build
uses: PyO3/maturin-action@v1
env:
PYO3_CROSS_LIB_DIR: "/opt/python/${{ matrix.python.abi }}"
CFLAGS: "${{ matrix.target.cflags }}"
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "${{ matrix.target.rustflags }}"
with:
target: "${{ matrix.target.target }}"
rust-toolchain: "${{ env.RUST_TOOLCHAIN }}"
rustup-components: rust-src
manylinux: "${{ matrix.python.manylinux }}"
args: --release --strip --out=dist --features=${{ matrix.target.features }} -i ${{ matrix.python.interpreter }}
- name: Store wheels
if: matrix.python.publish == true
uses: actions/upload-artifact@v4
with:
name: "orjson_manylinux_${{ matrix.target.arch }}_${{ matrix.python.interpreter }}"
path: dist
overwrite: true
retention-days: 1
if-no-files-found: "error"
compression-level: 0
- name: setup-qemu-container
if: "matrix.target.arch == 's390x'"
uses: sandervocke/setup-qemu-container@v1
with:
container: registry.fedoraproject.org/fedora:43
arch: ${{ matrix.target.arch }}
podman_args: "-v .:/orjson -v /tmp:/tmp --workdir /orjson"
- name: setup-shell-wrapper
uses: sandervocke/setup-shell-wrapper@v1
- name: Emulated Test
if: "matrix.target.arch == 's390x'"
shell: wrap-shell {0}
env:
WRAP_SHELL: run-in-container.sh
run: |
set -eou pipefail
dnf install --setopt=install_weak_deps=false -y ${{ matrix.python.interpreter }} python3-uv
uv venv --python ${{ matrix.python.interpreter }}
source .venv/bin/activate
uv pip install -r test/requirements.txt
uv pip install dist/orjson*.whl
pytest -v test
musllinux_amd64:
runs-on: ubuntu-24.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.14', pytest: '1', publish: true },
{ version: '3.13', pytest: '1', publish: true },
{ version: '3.12', pytest: '1', publish: true },
{ version: '3.11', pytest: '0', publish: true },
{ version: '3.10', pytest: '0', publish: true },
{ version: '3.9', pytest: '0', publish: true },
]
platform:
- target: x86_64-unknown-linux-musl
arch: x86_64
platform: linux/amd64
features: avx512,unwind
- target: i686-unknown-linux-musl
arch: i686
platform: linux/386
features: unwind
steps:
- uses: actions/checkout@v5
- name: build-std
run: |
mkdir .cargo
cp ci/config.toml .cargo/config.toml
- name: Build
uses: PyO3/maturin-action@v1
env:
CC: "gcc"
CFLAGS: "-O2"
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "-Z unstable-options -C panic=immediate-abort -Z mir-opt-level=4 -Z threads=2 -D warnings -C target-feature=-crt-static"
with:
rust-toolchain: "${{ env.RUST_TOOLCHAIN }}"
rustup-components: rust-src
target: "${{ matrix.platform.target }}"
manylinux: musllinux_1_2
args: --release --strip --out=dist --features=${{ matrix.platform.features }} -i python${{ matrix.python.version }}
- name: Test
uses: addnab/docker-run-action@v3
with:
image: "quay.io/pypa/musllinux_1_2_${{ matrix.platform.arch }}:2025.07.25-1"
options: -v ${{ github.workspace }}:/io -w /io
run: |
apk add tzdata
sed -i '/^psutil/d' test/requirements.txt # missing 3.11, 3.12 wheels
sed -i '/^numpy/d' test/requirements.txt
python${{ matrix.python.version }} -m venv venv
venv/bin/pip install -U pip wheel
venv/bin/pip install orjson --no-index --find-links dist/ --force-reinstall
# segfault on starting pytest after January 2025 on 3.11 and older; artifact works fine
if [ ${{ matrix.python.pytest }} == '1' ]; then
venv/bin/pip install -r test/requirements.txt
PYTHONMALLOC="debug" venv/bin/python -m pytest -v test
fi
- name: Store wheels
if: matrix.python.publish == true
uses: actions/upload-artifact@v4
with:
name: orjson_musllinux_${{ matrix.platform.arch }}_${{ matrix.python.version }}
path: dist
overwrite: true
retention-days: 1
if-no-files-found: "error"
compression-level: 0
musllinux_aarch64:
runs-on: ubuntu-24.04-arm
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.14', publish: true },
{ version: '3.13', publish: true },
{ version: '3.12', publish: true },
{ version: '3.11', publish: true },
{ version: '3.10', publish: true },
{ version: '3.9', publish: true },
]
platform:
- target: aarch64-unknown-linux-musl
arch: aarch64
platform: linux/arm64
features: generic_simd,unwind
- target: armv7-unknown-linux-musleabihf
arch: armv7l
platform: linux/arm/v7
features: ''
steps:
- uses: actions/checkout@v5
- name: build-std
run: |
mkdir .cargo
cp ci/config.toml .cargo/config.toml
- name: Build
uses: PyO3/maturin-action@v1
env:
CC: "gcc"
CFLAGS: "-O2"
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "-Z unstable-options -C panic=immediate-abort -Z mir-opt-level=4 -Z threads=2 -D warnings -C target-feature=-crt-static"
with:
rust-toolchain: "${{ env.RUST_TOOLCHAIN }}"
rustup-components: rust-src
target: "${{ matrix.platform.target }}"
manylinux: musllinux_1_2
args: --release --strip --out=dist --features=${{ matrix.platform.features }} -i python${{ matrix.python.version }}
- name: Test
uses: addnab/docker-run-action@v3
with:
image: "quay.io/pypa/musllinux_1_2_${{ matrix.platform.arch }}:2025.07.25-1"
options: -v ${{ github.workspace }}:/io -w /io
run: |
apk add tzdata
sed -i '/^psutil/d' test/requirements.txt # missing 3.11, 3.12 wheels
sed -i '/^numpy/d' test/requirements.txt
python${{ matrix.python.version }} -m venv venv
venv/bin/pip install -U pip wheel
venv/bin/pip install -r test/requirements.txt
venv/bin/pip install orjson --no-index --find-links dist/ --force-reinstall
export PYTHONMALLOC="debug"
venv/bin/python -m pytest -v test
- name: Store wheels
if: matrix.python.publish == true
uses: actions/upload-artifact@v4
with:
name: orjson_musllinux_${{ matrix.platform.arch }}_${{ matrix.python.version }}
path: dist
overwrite: true
retention-days: 1
if-no-files-found: "error"
compression-level: 0
macos_aarch64:
runs-on: macos-26
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.14t', macosx_target: "15.0", publish: false },
{ version: '3.14', macosx_target: "15.0", publish: true },
{ version: '3.13', macosx_target: "15.0", publish: true },
{ version: '3.12', macosx_target: "15.0", publish: true },
{ version: '3.11', macosx_target: "15.0", publish: true },
]
env:
CC: "clang"
LDFLAGS: "-Wl,--as-needed"
CFLAGS: "-O2 -fstrict-aliasing -fno-plt -mcpu=apple-m1 -mtune=generic"
RUSTFLAGS: "-Z unstable-options -C panic=immediate-abort -Z mir-opt-level=4 -Z threads=3 -D warnings"
PATH: "/Users/runner/work/orjson/orjson/.venv/bin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/bin:/bin:/usr/sbin:/sbin"
steps:
- name: CPU info
run: sysctl -a | grep brand
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
allow-prereleases: true
python-version: "${{ matrix.python.version }}"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "${{ env.RUST_TOOLCHAIN }}"
targets: "aarch64-apple-darwin"
components: "rust-src"
- name: Build environment
run: |
cargo fetch --target aarch64-apple-darwin &
export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python python${{ matrix.python.version }}
uv pip install --upgrade "maturin>=1,<2" -r test/requirements.txt -r integration/requirements.txt
mkdir .cargo
cp ci/config.toml .cargo/config.toml
- name: maturin
run: |
export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH
MACOSX_DEPLOYMENT_TARGET="${{ matrix.python.macosx_target }}" \
PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") \
maturin build \
--release \
--strip \
--features=generic_simd \
--interpreter python${{ matrix.python.version }} \
--target=aarch64-apple-darwin
uv pip install target/wheels/orjson*.whl
- run: pytest -v test
env:
PYTHONMALLOC: "debug"
- run: source .venv/bin/activate && ./integration/run thread
- run: source .venv/bin/activate && ./integration/run http
- run: source .venv/bin/activate && ./integration/run init
- name: Store wheels
if: matrix.python.publish == true
uses: actions/upload-artifact@v4
with:
name: orjson_macos_aarch64_${{ matrix.python.version }}
path: target/wheels
overwrite: true
retention-days: 1
if-no-files-found: "error"
compression-level: 0
macos_universal2_aarch64:
runs-on: macos-26
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.14', macosx_target: "10.15", publish: true },
{ version: '3.13', macosx_target: "10.15", publish: true },
{ version: '3.12', macosx_target: "10.15", publish: true },
{ version: '3.11', macosx_target: "10.15", publish: true },
{ version: '3.10', macosx_target: "10.15", publish: true },
{ version: '3.9', macosx_target: "10.15", publish: true },
]
env:
CC: "clang"
CFLAGS: "-O2 -fstrict-aliasing"
LDFLAGS: "-Wl,--as-needed"
CFLAGS_x86_64_apple_darwin: "-O2 -fstrict-aliasing -fno-plt -march=x86-64-v2 -mtune=generic"
CFLAGS_aarch64_apple_darwin: "-O2 -fstrict-aliasing -fno-plt -mcpu=apple-m1 -mtune=generic"
RUSTFLAGS: "-Z unstable-options -C panic=immediate-abort -Z mir-opt-level=4 -Z threads=3 -D warnings"
PATH: "/Users/runner/work/orjson/orjson/.venv/bin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/bin:/bin:/usr/sbin:/sbin"
steps:
- name: CPU info
run: sysctl -a | grep brand
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
allow-prereleases: true
python-version: "${{ matrix.python.version }}"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "${{ env.RUST_TOOLCHAIN }}"
targets: "aarch64-apple-darwin, x86_64-apple-darwin"
components: "rust-src"
- name: Build environment
run: |
cargo fetch --target aarch64-apple-darwin &
export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python python${{ matrix.python.version }}
uv pip install --upgrade "maturin>=1,<2" -r test/requirements.txt -r integration/requirements.txt
mkdir .cargo
cp ci/config.toml .cargo/config.toml
- name: maturin
run: |
export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH
MACOSX_DEPLOYMENT_TARGET="${{ matrix.python.macosx_target }}" \
PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") \
maturin build \
--release \
--strip \
--features=generic_simd \
--interpreter python${{ matrix.python.version }} \
--target=universal2-apple-darwin
uv pip install target/wheels/orjson*.whl
- run: pytest -v test
env:
PYTHONMALLOC: "debug"
- run: source .venv/bin/activate && ./integration/run thread
- run: source .venv/bin/activate && ./integration/run http
- run: source .venv/bin/activate && ./integration/run init
- name: Store wheels
if: matrix.python.publish == true
uses: actions/upload-artifact@v4
with:
name: orjson_universal2_aarch64_${{ matrix.python.version }}
path: target/wheels
overwrite: true
retention-days: 1
if-no-files-found: "error"
compression-level: 0
windows_amd64:
runs-on: windows-2025
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.14', publish: true },
{ version: '3.13', publish: true },
{ version: '3.12', publish: true },
{ version: '3.11', publish: true },
{ version: '3.10', publish: true },
{ version: '3.9', publish: true },
]
platform: [
{ arch: "x64", target: "x86_64-pc-windows-msvc", features: "avx512" },
{ arch: "x86", target: "i686-pc-windows-msvc", features: "" },
]
env:
CFLAGS: "-O2"
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "-Z unstable-options -C panic=immediate-abort -Z mir-opt-level=4 -D warnings"
steps:
- name: CPU info
shell: pwsh
run: Get-WmiObject -Class Win32_Processor -ComputerName. | Select-Object -Property Name, NumberOfCores, NumberOfLogicalProcessors
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
allow-prereleases: true
python-version: "${{ matrix.python.version }}"
architecture: "${{ matrix.platform.arch }}"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "${{ env.RUST_TOOLCHAIN }}"
targets: "${{ matrix.platform.target }}"
components: "rust-src"
- name: Build environment
run: |
cargo fetch --target "${{ matrix.platform.target }}" &
python.exe -m pip install --upgrade pip "maturin>=1,<2" wheel
python.exe -m pip install -r test\requirements.txt
mkdir .cargo
cp ci\config.toml .cargo\config.toml
- name: maturin
run: |
maturin.exe build --release --strip --features="${{ matrix.platform.features }}" --target="${{ matrix.platform.target }}"
python.exe -m pip install orjson --no-index --find-links target\wheels
- run: python.exe -m pytest -s -rxX -v test
env:
PYTHONMALLOC: "debug"
- name: Store wheels
if: matrix.python.publish == true
uses: actions/upload-artifact@v4
with:
name: orjson_windows_amd64_${{ matrix.platform.arch }}_${{ matrix.python.version }}
path: target\wheels
overwrite: true
retention-days: 1
if-no-files-found: "error"
compression-level: 0
windows_aarch64:
runs-on: windows-11-arm
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.14', publish: true },
{ version: '3.13', publish: true },
{ version: '3.12', publish: true },
{ version: '3.11', publish: true },
]
env:
CFLAGS: "-O2"
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "-Z unstable-options -C panic=immediate-abort -Z mir-opt-level=4 -D warnings"
TARGET: "aarch64-pc-windows-msvc"
steps:
- name: CPU info
shell: pwsh
run: Get-WmiObject -Class Win32_Processor -ComputerName. | Select-Object -Property Name, NumberOfCores, NumberOfLogicalProcessors
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
allow-prereleases: true
python-version: "${{ matrix.python.version }}"
architecture: "arm64"
# from maturin
- shell: pwsh
run: |
Invoke-WebRequest -Uri "https://static.rust-lang.org/rustup/dist/$env:TARGET/rustup-init.exe" -OutFile rustup-init.exe
.\rustup-init.exe --default-toolchain "$env:RUST_TOOLCHAIN-$env:TARGET" --profile minimal --component rust-src -y
"$env:USERPROFILE\.cargo\bin" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
"CARGO_HOME=$env:USERPROFILE\.cargo" | Out-File -Append -Encoding ascii $env:GITHUB_ENV
- name: Build environment
run: |
cargo fetch --target "$" &
python.exe -m sysconfig
python.exe -m pip install --upgrade pip "maturin>=1,<2" wheel
python.exe -m pip install -r test\requirements.txt
mkdir .cargo
cp ci\config.toml .cargo\config.toml
- name: maturin
run: |
maturin.exe build --release --strip --features=generic_simd --target="$env:TARGET"
python.exe -m pip install orjson --no-index --find-links target\wheels
- run: python.exe -m pytest -s -rxX -v test
env:
PYTHONMALLOC: "debug"
- name: Store wheels
if: matrix.python.publish == true
uses: actions/upload-artifact@v4
with:
name: orjson_windows_aarch64_${{ matrix.python.version }}
path: target\wheels
overwrite: true
retention-days: 1
if-no-files-found: "error"
compression-level: 0
pypi:
name: PyPI
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: [
macos_aarch64,
macos_universal2_aarch64,
manylinux_aarch64,
manylinux_amd64,
manylinux_cross,
musllinux_aarch64,
musllinux_amd64,
sdist,
windows_aarch64,
windows_amd64,
]
environment:
name: PyPI
url: https://pypi.org/p/orjson
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/
pattern: orjson_*
- run: ls -1 dist/
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- run: ./script/check-pypi dist
- name: Publish distribution to PyPI
if: "startsWith(github.ref, 'refs/tags/')"
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
packages-dir: dist
skip-existing: true
verbose: true