-
Notifications
You must be signed in to change notification settings - Fork 1
171 lines (162 loc) · 6.23 KB
/
Copy pathbuild-exiv2-wheels.yml
File metadata and controls
171 lines (162 loc) · 6.23 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
166
167
168
169
170
171
name: Build python-exiv2 wheels
on: workflow_dispatch
jobs:
build:
name: build ${{ matrix.build }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- build: Linux-x64
runner: ubuntu-22.04
arch: x86_64
wget: wget
- build: Linux-arm64
runner: ubuntu-22.04-arm
arch: aarch64
wget: wget
- build: MacOS-x64
runner: macos-15-intel
target: 14.0
arch: x86_64
wget: wget
- build: MacOS-arm64
runner: macos-14
target: 14.0
arch: arm64
wget: wget
- build: Windows-x64
runner: windows-2022
arch: AMD64
wget: c:/msys64/usr/bin/wget.exe
env:
EXIV2_SRC: >
https://github.com/Exiv2/exiv2/archive/refs/tags/v0.28.8.tar.gz
EXIV2_OPTIONS: >
-D EXIV2_BUILD_EXIV2_COMMAND=OFF
-D EXIV2_BUILD_SAMPLES=OFF
-D EXIV2_BUILD_UNIT_TESTS=OFF
-D EXIV2_ENABLE_FILESYSTEM_ACCESS=ON
-D EXIV2_ENABLE_NLS=ON
-D EXIV2_TEAM_WARNINGS_AS_ERRORS=OFF
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.target }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v6
- name: Download exiv2
run: |
mkdir libexiv2
${{ matrix.wget }} -nv $EXIV2_SRC -O - |
tar zxf - --directory libexiv2 --strip-components=1
- name: Download inih
if: ${{ runner.os == 'Linux' }}
env:
SRC: https://github.com/benhoyt/inih/archive/r58/inih-r58.tar.gz
run: |
mkdir inih
wget -nv $SRC -O - |
tar zxf - --directory inih --strip-components=1
- name: Download gettext
if: ${{ runner.os == 'Windows' }}
env:
SRC: https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-shared-64.zip
run: |
mkdir gettext
cd gettext
c:/msys64/usr/bin/wget.exe -nv $SRC -O gettext.zip
unzip gettext.zip
echo "${{ github.workspace }}\\gettext\\bin" >> "$GITHUB_PATH"
- name: Build exiv2 (Windows)
if: ${{ runner.os == 'Windows' }}
run: >
pip install conan==1.66.0 &&
cd libexiv2 &&
echo -e "24a25\n> self.requires('libgettext/0.21')" |
patch conanfile.py &&
cmake --preset win-release $EXIV2_OPTIONS
-G "Visual Studio 17 2022" &&
cmake --build build-win-release --config Release &&
cmake --install build-win-release --config Release &&
cp build-win-release/bin/libcurl.dll build-win-release/install/bin
- name: Build exiv2 (macOS)
if: ${{ runner.os == 'macOS' }}
run: >
brew install inih &&
cd libexiv2 &&
cmake --preset base_mac $EXIV2_OPTIONS
-D CMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} &&
cmake --build build-base_mac --config Release &&
cmake --install build-base_mac --config Release
- name: Build wheels (Python 3.6 & 3.7)
if: ${{ runner.os != 'macOS' }}
# cibuildwheel@v3.x omits Python 3.6 & 3.7
uses: pypa/cibuildwheel@v2.23.3
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
CIBW_ENVIRONMENT_LINUX: >
EXIV2_ROOT=libexiv2/build-linux-release/install
CIBW_ENVIRONMENT_MACOS: >
EXIV2_ROOT=libexiv2/build-base_mac/install
CIBW_ENVIRONMENT_WINDOWS: >
EXIV2_ROOT=libexiv2/build-win-release/install
CIBW_ENVIRONMENT_PASS_LINUX: EXIV2_OPTIONS
CIBW_BUILD: "cp36* cp37*"
CIBW_SKIP: "*musllinux*"
CIBW_TEST_COMMAND: >
python -m exiv2 -v &&
python -m unittest discover {project}/tests -v
CIBW_TEST_SKIP: cp36-macosx_x86_64 cp37-macosx_x86_64
CIBW_BEFORE_ALL_LINUX: >
yum install -y --nogpgcheck zlib-devel expat-devel gettext-devel
libcurl-devel brotli-devel meson &&
localedef -c -i de_DE -f UTF-8 de_DE.UTF-8 &&
pip install ninja &&
cd inih && mkdir build && cd build &&
meson setup --prefix=/usr --buildtype=release .. &&
ninja && ninja install &&
cd ../../libexiv2 &&
cmake --preset linux-release $EXIV2_OPTIONS
-D CONAN_AUTO_INSTALL=OFF &&
cmake --build build-linux-release --config Release &&
cmake --install build-linux-release --config Release
- name: Build wheels (Python 3.8+)
uses: pypa/cibuildwheel@v3.4.0
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
CIBW_ENVIRONMENT_LINUX: >
EXIV2_ROOT=libexiv2/build-linux-release/install
CIBW_ENVIRONMENT_MACOS: >
EXIV2_ROOT=libexiv2/build-base_mac/install
CIBW_ENVIRONMENT_WINDOWS: >
EXIV2_ROOT=libexiv2/build-win-release/install
CIBW_ENVIRONMENT_PASS_LINUX: EXIV2_OPTIONS
CIBW_BUILD: "cp*"
CIBW_SKIP: "*musllinux*"
CIBW_TEST_COMMAND: >
python -m exiv2 -v &&
python -m unittest discover {project}/tests -v
CIBW_BEFORE_ALL_LINUX: >
yum install -y --nogpgcheck zlib-devel expat-devel gettext-devel
libcurl-devel brotli-devel meson &&
localedef -c -i de_DE -f UTF-8 de_DE.UTF-8 &&
pip install ninja &&
cd inih && mkdir build && cd build &&
meson setup --prefix=/usr --buildtype=release .. &&
ninja && ninja install &&
cd ../../libexiv2 &&
cmake --preset linux-release $EXIV2_OPTIONS
-D CONAN_AUTO_INSTALL=OFF &&
cmake --build build-linux-release --config Release &&
cmake --install build-linux-release --config Release
- name: Store results
uses: actions/upload-artifact@v6
with:
name: exiv2-wheels-${{ matrix.build }}
path: wheelhouse/*.whl