-
Notifications
You must be signed in to change notification settings - Fork 7
91 lines (80 loc) · 2.49 KB
/
build_python_linux.yaml
File metadata and controls
91 lines (80 loc) · 2.49 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Build - Python Linux
on:
workflow_call:
inputs:
publish:
type: boolean
required: false
description: 'Publish package to PyPI'
workflow_dispatch:
inputs:
publish:
type: boolean
required: false
description: 'Publish package to PyPI'
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/brekkylab/ailoy-buildpack-linux:20251126
env:
PYTHON_BIN: /opt/python/cp310-cp310/bin
permissions:
packages: read
outputs:
wheel_filename: ${{ steps.save_wheel_name.outputs.wheel_filename }}
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install maturin
working-directory: bindings/python
run: |
# maturin does not work outside virtualenv, so prepare one
$PYTHON_BIN/python -m venv .venv
source .venv/bin/activate
pip install maturin
- name: Build wheel
working-directory: bindings/python
run: |
source .venv/bin/activate
maturin build --out ./dist
env:
OPENSSL_DIR: /opt/openssl
VULKAN_SDK: /opt/vulkan-sdk
LD_LIBRARY_PATH: /opt/lapack/lib:/opt/vulkan-sdk/lib
- name: Repair wheel
id: save_wheel_name
working-directory: bindings/python
run: |
mkdir -p wheelhouse
auditwheel repair dist/*.whl -w wheelhouse \
--plat manylinux_2_28_x86_64 \
--exclude libvulkan.so.*
auditwheel show wheelhouse/*.whl
WHEEL_NAME=$(basename wheelhouse/*.whl)
echo "wheel_filename=$WHEEL_NAME" >> $GITHUB_OUTPUT
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.save_wheel_name.outputs.wheel_filename }}
path: ${{ github.workspace }}/bindings/python/wheelhouse/${{ steps.save_wheel_name.outputs.wheel_filename }}
publish:
runs-on: ubuntu-latest
needs: build
if: ${{ inputs.publish }}
permissions:
id-token: write
steps:
- name: Download wheel artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.wheel_filename }}
path: wheelhouse
- name: Publish wheel to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse