forked from AloneLiberty/FlipperNestedRecovery
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (82 loc) · 3.42 KB
/
build.yml
File metadata and controls
94 lines (82 loc) · 3.42 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
name: Build
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Install Microsoft Visual C++ 2010 Redistributable Package
if: runner.os == 'Windows'
run: |
curl -L -o vcredist.exe https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe
Start-Process -FilePath vcredist.exe -ArgumentList '/Q' -Wait -PassThru
- name: Set up pthreads
if: runner.os == 'Windows'
run: |
curl -O https://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip
7z x -y pthreads-w32-2-9-1-release.zip -opthreads
robocopy pthreads\Pre-built.2\dll\x64 build\pthreads /COPYALL /E || true
robocopy pthreads\Pre-built.2\include build\pthreads /COPYALL /E || true
robocopy pthreads\Pre-built.2\lib\x64 build\pthreads /COPYALL /E || true
- name: Set up lzma
if: runner.os == 'Windows'
run: |
curl -O -L https://github.com/ShiftMediaProject/liblzma/releases/download/v5.4.1/liblzma_v5.4.1_msvc17.zip
7z x -y liblzma_v5.4.1_msvc17.zip -oliblzma
robocopy liblzma\bin\x64 build\lzma /COPYALL /E || true
robocopy liblzma\include build\lzma /COPYALL /E || true
robocopy liblzma\lib\x64 build\lzma /COPYALL /E || true
- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0
env:
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ARCHS_LINUX: "x86_64 aarch64"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/tests"
CIBW_TEST_SKIP: "*-*linux_aarch64 *-macosx_arm64"
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path build\\pthreads;build\\lzma -w {dest_dir} {wheel}"
# CIBW_BEFORE_ALL_LINUX: "yum install -y xz xz-devel || apk add xz-dev"
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"
# Use manylinux_2_28 image
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
# Robust package installation
CIBW_BEFORE_ALL_LINUX: |
if command -v dnf; then \
dnf install -y xz xz-devel; \
elif command -v yum; then \
yum install -y xz xz-devel; \
elif command -v apt-get; then \
apt-get update && apt-get install -y xz-utils liblzma-dev; \
elif command -v apk; then \
apk add xz-dev; \
else \
echo "No known package manager found"; \
exit 1; \
fi
# Install xz on macOS
CIBW_BEFORE_ALL_MACOS: brew install xz
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz