Skip to content

Commit

Permalink
use matrix to avoid write anything twice
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Nov 19, 2024
1 parent d43274f commit d8fc973
Showing 1 changed file with 15 additions and 69 deletions.
84 changes: 15 additions & 69 deletions .github/workflows/release_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ name: Release Python
on:
push:
tags:
- '*'
- "*"
pull_request:
branches:
- main
Expand Down Expand Up @@ -51,91 +51,37 @@ jobs:
name: wheels
path: bindings/python/dist

linux:
runs-on: ubuntu-latest
wheels:
runs-on: "${{ matrix.os }}"
strategy:
matrix:
target: [ x86_64, aarch64, armv7l ]
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
- uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
working-directory: "bindings/python"
command: build
args: --release -o dist -i python3.11 --features=pyo3/extension-module,services-all,abi3
sccache: true
env:
# Workaround ring 0.17 build issue
CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
- uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
working-directory: "bindings/python"
command: build
args: --release -o dist -i python3.10 --features=pyo3/extension-module,services-all
sccache: true
env:
# Workaround ring 0.17 build issue
CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: bindings/python/dist

windows:
runs-on: windows-latest
env:
# help avoid compile local crate twice
CARGO_TARGET_DIR: './target/'
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
- uses: PyO3/maturin-action@v1
with:
working-directory: "bindings/python"
command: build
args: --release -o dist -i python3.11 --features=pyo3/extension-module,services-all,abi3
sccache: true
- uses: PyO3/maturin-action@v1
with:
working-directory: "bindings/python"
command: build
args: --release -o dist -i python3.10 --features=pyo3/extension-module,services-all
sccache: true
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: bindings/python/dist

macos:
runs-on: macos-latest
include:
- { os: windows-latest }
- { os: macos-latest, target: "universal2-apple-darwin" }
- { os: ubuntu-latest, target: "x86_64" }
- { os: ubuntu-latest, target: "aarch64" }
- { os: ubuntu-latest, target: "armv7l" }
env:
# help avoid compile local crate twice
CARGO_TARGET_DIR: './target/'
CARGO_TARGET_DIR: "./target/"
# Workaround ring 0.17 build issue
CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
- uses: PyO3/maturin-action@v1
with:
working-directory: "bindings/python"
target: "${{ matrix.target }}"
command: build
target: universal2-apple-darwin
args: --release -o dist -i python3.11 --features=pyo3/extension-module,services-all,abi3
sccache: true
- uses: PyO3/maturin-action@v1
with:
working-directory: "bindings/python"
target: "${{ matrix.target }}"
command: build
target: universal2-apple-darwin
args: --release -o dist -i python3.10 --features=pyo3/extension-module,services-all
sccache: true
- name: Upload wheels
Expand All @@ -151,7 +97,7 @@ jobs:
permissions:
contents: read
id-token: write
needs: [ macos, linux, windows ]
needs: [sdist, wheels]
steps:
- uses: actions/download-artifact@v3
with:
Expand Down

0 comments on commit d8fc973

Please sign in to comment.