-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
39 lines (38 loc) · 1.25 KB
/
action.yml
File metadata and controls
39 lines (38 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: "Build Python Package"
description: "Build and package the library"
inputs:
python-version:
description: "Python version"
required: true
runs:
using: composite
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Set target based on OS and arch
shell: bash
run: |
if [[ "${RUNNER_OS}" == "Linux" ]]; then
echo "TARGET=x86_64-unknown-linux-gnu" >> $GITHUB_ENV
elif [[ "${RUNNER_OS}" == "macOS" ]]; then
if [[ "${RUNNER_ARCH}" == "ARM64" ]]; then
echo "TARGET=aarch64-apple-darwin" >> $GITHUB_ENV
else
echo "TARGET=x86_64-apple-darwin" >> $GITHUB_ENV
fi
elif [[ "${RUNNER_OS}" == "Windows" ]]; then
echo "TARGET=x86_64-pc-windows-msvc" >> $GITHUB_ENV
fi
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ steps.target.outputs.target }}
args: --release --out dist --find-interpreter
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ steps.target.outputs.target }}
path: dist