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 8161613
Showing 1 changed file with 13 additions and 35 deletions.
48 changes: 13 additions & 35 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 @@ -55,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
target: [ x86_64, aarch64, armv7l ]
target: [x86_64, aarch64, armv7l]
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
Expand Down Expand Up @@ -88,54 +88,32 @@ jobs:
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
windows-or-macos:
runs-on: "${{ matrix.os }}"
strategy:
matrix:
include:
- { os: windows-latest }
- { os: macos-latest, include: 'universal2-apple-darwin' }
env:
# help avoid compile local crate twice
CARGO_TARGET_DIR: './target/'
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"
target: '${{ matrix.include }}'
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.include }}'
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 +129,7 @@ jobs:
permissions:
contents: read
id-token: write
needs: [ macos, linux, windows ]
needs: [macos, linux, windows]
steps:
- uses: actions/download-artifact@v3
with:
Expand Down

0 comments on commit 8161613

Please sign in to comment.