This repository was archived by the owner on Dec 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (126 loc) · 4.64 KB
/
PublishPyPI.yml
File metadata and controls
129 lines (126 loc) · 4.64 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build & Publish
on:
push:
tags: ["v*"]
workflow_dispatch:
jobs:
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux builds
- os: ubuntu-latest
cibw_archs: "auto"
deployment_target: ""
openblas_path: ""
py_tag: "cp310"
- os: ubuntu-latest
cibw_archs: "auto"
deployment_target: ""
openblas_path: ""
py_tag: "cp311"
- os: ubuntu-latest
cibw_archs: "auto"
deployment_target: ""
openblas_path: ""
py_tag: "cp312"
- os: ubuntu-latest
cibw_archs: "auto"
deployment_target: ""
openblas_path: ""
py_tag: "cp313"
# macOS Intel builds
- os: macos-13 # Intel Mac
cibw_archs: "x86_64"
deployment_target: "13.0"
openblas_path: "/usr/local/opt/openblas"
py_tag: "cp310"
- os: macos-13 # Intel Mac
cibw_archs: "x86_64"
deployment_target: "13.0"
openblas_path: "/usr/local/opt/openblas"
py_tag: "cp311"
- os: macos-13 # Intel Mac
cibw_archs: "x86_64"
deployment_target: "13.0"
openblas_path: "/usr/local/opt/openblas"
py_tag: "cp312"
- os: macos-13 # Intel Mac
cibw_archs: "x86_64"
deployment_target: "13.0"
openblas_path: "/usr/local/opt/openblas"
py_tag: "cp313"
# macOS Apple Silicon builds
- os: macos-latest # Apple Silicon Mac
cibw_archs: "arm64"
deployment_target: "15.0"
openblas_path: "/opt/homebrew/opt/openblas"
py_tag: "cp310"
- os: macos-latest # Apple Silicon Mac
cibw_archs: "arm64"
deployment_target: "15.0"
openblas_path: "/opt/homebrew/opt/openblas"
py_tag: "cp311"
- os: macos-latest # Apple Silicon Mac
cibw_archs: "arm64"
deployment_target: "15.0"
openblas_path: "/opt/homebrew/opt/openblas"
py_tag: "cp312"
- os: macos-latest # Apple Silicon Mac
cibw_archs: "arm64"
deployment_target: "15.0"
openblas_path: "/opt/homebrew/opt/openblas"
py_tag: "cp313"
steps:
- uses: actions/checkout@v6
- name: remove python/.gitignore
shell: bash
run: |
rm -f python/.gitignore
- name: prepare build
shell: bash
run: |
cd python
python prepare_build.py
- uses: pypa/cibuildwheel@v3.3.0
env:
CIBW_DEPENDENCY_VERSIONS: "latest"
CIBW_BUILD_VERBOSITY: 1
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28"
CIBW_BUILD: "${{ matrix.py_tag }}-*"
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=${{ matrix.deployment_target || '11.0' }}"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_SKIP: "*-manylinux_i686 *-musllinux_i686"
# Install OpenBLAS using micromamba (conda-forge) - separate for manylinux and musllinux
CIBW_BEFORE_ALL_MANYLINUX: "curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba && ./bin/micromamba create -y -p /opt/openblas && ./bin/micromamba install -y -c conda-forge openblas -p /opt/openblas --no-deps"
CIBW_BEFORE_ALL_MUSLLINUX: "apk add --no-cache bzip2 && curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba && ./bin/micromamba create -y -p /opt/openblas && ./bin/micromamba install -y -c conda-forge openblas -p /opt/openblas --no-deps"
CIBW_BEFORE_ALL_MACOS: "brew install openblas"
with:
package-dir: ./python
output-dir: dist
- uses: actions/upload-artifact@v5
with:
name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}-${{ matrix.py_tag }}
path: dist/*
publish-pypi:
needs: build-wheels
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write # Required for Trusted Publishing
contents: read
steps:
- uses: actions/download-artifact@v6
with:
path: dist
merge-multiple: true
- name: Publish to PyPI (Trusted)
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
repository-url: https://upload.pypi.org/legacy/
verbose: true
skip-existing: true
attestations: false # Disable attestations due to Sigstore service issues