Update linux.yaml #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: linux | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
musllinux_1_2: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python: [ | |
{ version: '3.12' }, | |
{ version: '3.11' }, | |
{ version: '3.10' }, | |
{ version: '3.9' }, | |
{ version: '3.8' }, | |
] | |
platform: | |
- target: aarch64-unknown-linux-musl | |
arch: aarch64 | |
platform: linux/arm64 | |
- target: x86_64-unknown-linux-musl | |
arch: x86_64 | |
platform: linux/amd64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
uses: PyO3/maturin-action@v1 | |
env: | |
CC: "gcc" | |
CFLAGS: "-O2" | |
LDFLAGS: "-O2 -flto -Wl,--as-needed" | |
RUSTFLAGS: "-C target-feature=-crt-static -Z mir-opt-level=4" | |
CARGO_UNSTABLE_SPARSE_REGISTRY: "true" | |
with: | |
rust-toolchain: nightly-2024-02-13 | |
rustup-components: rust-src | |
target: ${{ matrix.platform.target }} | |
manylinux: musllinux_1_2 | |
args: --release --strip --out=dist -i python${{ matrix.python.version }} | |
- name: Set up QEMU | |
if: matrix.platform.arch != 'x86_64' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:qemu-v8.1.4 | |
platforms: ${{ matrix.platform.platform }} | |
- name: Store wheels | |
if: "startsWith(github.ref, 'refs/tags/')" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
retention-days: 1 | |
pypi: | |
name: PyPI | |
permissions: | |
# trusted publisher | |
id-token: write | |
contents: write | |
runs-on: ubuntu-22.04 | |
if: "startsWith(github.ref, 'refs/tags/')" | |
needs: [musllinux_1_2] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.9" | |
- run: pip install "maturin>=1,<2" | |
- run: ls -1 . | |
- name: deploy wheel | |
run: maturin upload --skip-existing --username "${{ secrets.PYPI_USER_NAME }}" *.whl | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
- name: deploy sdist | |
run: maturin upload --skip-existing --username "${{ secrets.PYPI_USER_NAME }}" *.tar.gz | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |