Repository navigation
165 lines (148 loc) · 5.26 KB
/
Copy pathpublish.yml
File metadata and controls
165 lines (148 loc) · 5.26 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: "Publish"
on:
push:
tags:
# Publish on any tag starting with a `v`, e.g., v0.1.0
- v*
jobs:
build-wheels:
name: Build wheels (${{ matrix.label }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
label: linux
cibw_archs: x86_64
cibw_build: cp312-manylinux_x86_64
before_linux: |
yum install -y autoconf automake libtool m4
cd {project}
unset CFLAGS LDFLAGS CPLUS_INCLUDE_PATH
make build-m4ri
make build-sanity
env_linux: >
CFLAGS="-I{project}/src/scloop/utils/linear_algebra_gf2/include"
LDFLAGS="-L{project}/src/scloop/utils/linear_algebra_gf2"
CPLUS_INCLUDE_PATH="{project}/src/scloop/data:{project}/src/scloop/utils/distance_metrics"
- os: macos-14
label: macos
cibw_archs: "x86_64 arm64"
cibw_build: cp312-macosx_*
before_macos: |
brew install autoconf automake libtool llvm libomp
export PATH="$(brew --prefix llvm)/bin:$PATH"
cd {project}
CC="$(brew --prefix llvm)/bin/clang" CXX="$(brew --prefix llvm)/bin/clang++" \
CFLAGS="-fopenmp -O3 -fPIC" \
LDFLAGS="-L$(brew --prefix llvm)/lib -Wl,-rpath,$(brew --prefix llvm)/lib -lomp" \
make build-m4ri
make build-sanity
env_macos: >
CC="/opt/homebrew/opt/llvm/bin/clang"
CXX="/opt/homebrew/opt/llvm/bin/clang++"
MACOSX_DEPLOYMENT_TARGET=14.0
CFLAGS="-I{project}/src/scloop/utils/linear_algebra_gf2/include -fopenmp"
LDFLAGS="-L{project}/src/scloop/utils/linear_algebra_gf2 -Wl,-rpath,{project}/src/scloop/utils/linear_algebra_gf2 -L/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib -lomp"
CPLUS_INCLUDE_PATH="{project}/src/scloop/data:{project}/src/scloop/utils/distance_metrics"
- os: windows-2022
label: windows
cibw_archs: AMD64
cibw_build: cp312-win_amd64
before_windows: |
msys2 -c "export PATH=/usr/bin:$PATH; cd {project} && make build-m4ri && make build-sanity"
env_windows: >
MSYSTEM=UCRT64
MSYS2_PATH_TYPE=inherit
CC=x86_64-w64-mingw32-gcc
CXX=x86_64-w64-mingw32-g++
CFLAGS="-O3"
config_settings_windows: >
--global-option=build_ext --global-option=--compiler=mingw32
steps:
- name: Checkout
uses: actions/checkout@v5
with:
submodules: recursive
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install MSYS2 toolchain
if: matrix.label == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: >-
autoconf
automake
libtool
make
mingw-w64-ucrt-x86_64-toolchain
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_BEFORE_ALL_LINUX: ${{ matrix.before_linux || '' }}
CIBW_BEFORE_ALL_MACOS: ${{ matrix.before_macos || '' }}
CIBW_BEFORE_ALL_WINDOWS: ${{ matrix.before_windows || '' }}
CIBW_ENVIRONMENT_LINUX: ${{ matrix.env_linux || '' }}
CIBW_ENVIRONMENT_MACOS: ${{ matrix.env_macos || '' }}
CIBW_ENVIRONMENT_WINDOWS: ${{ matrix.env_windows || '' }}
CIBW_CONFIG_SETTINGS_WINDOWS: ${{ matrix.config_settings_windows || '' }}
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.label }}
path: wheelhouse/*.whl
build-sdist:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
submodules: recursive
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake libtool m4 build-essential
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build source distribution
run: |
python -m pip install build
make build-m4ri
python -m build --sdist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
publish:
needs:
- build-wheels
- build-sdist
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
contents: read
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: dist