Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

GitHub Action to install and run a custom maturin command with built-in support for cross compilation

License

NotificationsYou must be signed in to change notification settings

PyO3/maturin-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

GitHub Actions

GitHub Action to install and run a custommaturin command with built-in support for cross compilation.

Usage

-uses:PyO3/maturin-action@v1with:command:buildargs:--release

To generate a GitHub Actions workflow for your project, try thematurin generate-ci github command.

mkdir -p .github/workflowsmaturin generate-ci github> .github/workflows/CI.yml

Examples

If you want to build and publish a Python extension module for common Python versions, operating systems, and CPU architectures,take a look at the following examples:

Inputs

NameRequiredDescriptionTypeDefault
commandNomaturin command to runstringbuild
argsNoArguments to pass tomaturin subcommandstring
maturin-versionNoThe version ofmaturin to use. Must match atagged releasestringlatest
manylinuxNoControl the manylinux platform tag on linux, ignored on other platforms, useauto to build for lowest compatiblestringDefaults toauto for thepublish command
targetNoThe--target option for Cargostring
containerNomanylinux docker container image namestringDefault depends ontarget andmanylinux options, Set tooff to disable manylinux docker build and build on the host instead.
docker-optionsNoAdditional Docker run options, for passing environment variables and etc.string
rust-toolchainNoRust toolchain name.stringDefaults tostable for Docker build. To use the latest available version for the host build, the user must specify this in the CI config or repo config.
rustup-componentsNoRustup componentsstringDefaults to empty
working-directoryNoThe working directory to run the command instringDefaults to the root of the repository
sccacheNoEnable sccache for faster buildsbooleanDefaults tofalse
before-script-linuxNoScript to run before the maturin command on Linuxstring

manylinux Docker container

By default, this action uses the following containers for supported architectures and manylinux versions.

ArchitectureManylinux versionDefault containerNote
x86_642010/2_12quay.io/pypa/manylinux2010_x86_64:latest
x86_642014/2_17quay.io/pypa/manylinux2014_x86_64:latest
x86_642_24quay.io/pypa/manylinux_2_24_x86_64:latestDeprecated
x86_642_28quay.io/pypa/manylinux_2_28_x86_64:latest
i6862010/2_12quay.io/pypa/manylinux2010_i686:latest
i6862014/2_17quay.io/pypa/manylinux2014_i686:latest
i6862_24quay.io/pypa/manylinux_2_24_i686:latestDeprecated
aarch642014/2_17ghcr.io/rust-cross/manylinux2014-cross:aarch64
aarch642_24messense/manylinux_2_24-cross:aarch64Deprecated
aarch642_28ghcr.io/rust-cross/manylinux_2_28-cross:aarch64
armv7l2014/2_17ghcr.io/rust-cross/manylinux2014-cross:armv7
armv7l2_24messense/manylinux_2_24-cross:armv7Deprecated
armv7l2_28ghcr.io/rust-cross/manylinux_2_28-cross:armv7
ppc64le2014/2_17ghcr.io/rust-cross/manylinux2014-cross:ppc64le
ppc64le2_24messense/manylinux_2_24-cross:ppc64leDeprecated
ppc64le2_28ghcr.io/rust-cross/manylinux_2_28-cross:ppc64le
ppc642014/2_17ghcr.io/rust-cross/manylinux2014-cross:ppc64
s390x2014/2_17ghcr.io/rust-cross/manylinux2014-cross:s390x
s390x2_24messense/manylinux_2_24-cross:s390xDeprecated
s390x2_28ghcr.io/rust-cross/manylinux_2_28-cross:s390x

You can override it by supplying thecontainer input.Note that if use official manylinux docker images for platforms other thanx86_64 andi686,you will need to setup QEMU before using this action, for example

-name:Setup QEMUuses:docker/setup-qemu-action@v1-uses:PyO3/maturin-action@v1with:command:buildargs:--release

Note that theactions/setup-python action won't affect manylinux build since it's containerized,so if you want to build for certain Python version for Linux, use-i pythonX.Y in theargs option inPyO3/maturin-action instead, for example

-uses:PyO3/maturin-action@v1with:args:--release -i python3.10

Contributing

To build after code changes:

npm run all

License

This work is released under the MIT license. A copy of the license is provided in theLICENSE file.


[8]ページ先頭

©2009-2025 Movatter.jp