Skip to content

Commit c7dc47f

Browse files
Merge branch 'workflow' into 0.17.5
2 parents 35391b7 + 1a7cf3f commit c7dc47f

File tree

1 file changed

+131
-0
lines changed

1 file changed

+131
-0
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Build python-exiv2 wheels
2+
on: workflow_dispatch
3+
4+
jobs:
5+
build:
6+
name: build on ${{ matrix.os }}
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os:
11+
- ubuntu-22.04
12+
- ubuntu-22.04-arm
13+
- macos-13
14+
- macos-14
15+
- windows-2022
16+
include:
17+
- wget: wget
18+
- os: macos-13
19+
arch: x86_64
20+
target: 13.0
21+
- os: macos-14
22+
arch: arm64
23+
target: 14.0
24+
- os: windows-2022
25+
wget: c:/msys64/usr/bin/wget.exe
26+
env:
27+
EXIV2_SRC: >
28+
https://github.com/Exiv2/exiv2/archive/refs/tags/v0.28.7.tar.gz
29+
EXIV2_OPTIONS: >
30+
-D EXIV2_BUILD_EXIV2_COMMAND=OFF
31+
-D EXIV2_BUILD_SAMPLES=OFF
32+
-D EXIV2_BUILD_UNIT_TESTS=OFF
33+
-D EXIV2_ENABLE_FILESYSTEM_ACCESS=ON
34+
-D EXIV2_ENABLE_NLS=ON
35+
-D EXIV2_TEAM_WARNINGS_AS_ERRORS=OFF
36+
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.target }}
37+
defaults:
38+
run:
39+
shell: bash
40+
steps:
41+
- name: Check out repository code
42+
uses: actions/checkout@v4
43+
44+
- name: Download exiv2
45+
run: |
46+
mkdir libexiv2
47+
${{ matrix.wget }} -nv $EXIV2_SRC -O - |
48+
tar zxf - --directory libexiv2 --strip-components=1
49+
50+
- name: Download inih
51+
if: ${{ runner.os == 'Linux' }}
52+
env:
53+
SRC: https://github.com/benhoyt/inih/archive/r58/inih-r58.tar.gz
54+
run: |
55+
mkdir inih
56+
wget -nv $SRC -O - |
57+
tar zxf - --directory inih --strip-components=1
58+
59+
- name: Download gettext
60+
if: ${{ runner.os == 'Windows' }}
61+
env:
62+
SRC: https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-shared-64.zip
63+
run: |
64+
mkdir gettext
65+
cd gettext
66+
c:/msys64/usr/bin/wget.exe -nv $SRC -O gettext.zip
67+
unzip gettext.zip
68+
echo "${{ github.workspace }}\\gettext\\bin" >> "$GITHUB_PATH"
69+
70+
- name: Build exiv2 (Windows)
71+
if: ${{ runner.os == 'Windows' }}
72+
run: >
73+
pip install conan==1.59.0 &&
74+
cd libexiv2 &&
75+
echo -e "24a25\n> self.requires('libgettext/0.21')" |
76+
patch conanfile.py &&
77+
cmake --preset win-release $EXIV2_OPTIONS
78+
-G "Visual Studio 17 2022" &&
79+
cmake --build build-win-release --config Release &&
80+
cmake --install build-win-release --config Release &&
81+
cp build-win-release/bin/libcurl.dll build-win-release/install/bin
82+
83+
- name: Build exiv2 (macOS)
84+
if: ${{ runner.os == 'macOS' }}
85+
run: >
86+
brew install inih &&
87+
cd libexiv2 &&
88+
cmake --preset base_mac $EXIV2_OPTIONS
89+
-D CMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} &&
90+
cmake --build build-base_mac --config Release &&
91+
cmake --install build-base_mac --config Release
92+
93+
- name: Build wheels
94+
# [email protected] omits Python 3.6 & 3.7
95+
uses: pypa/[email protected]
96+
env:
97+
CIBW_ARCHS: auto64
98+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
99+
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
100+
CIBW_ENVIRONMENT_LINUX: >
101+
EXIV2_ROOT=libexiv2/build-linux-release/install
102+
CIBW_ENVIRONMENT_MACOS: >
103+
EXIV2_ROOT=libexiv2/build-base_mac/install
104+
CIBW_ENVIRONMENT_WINDOWS: >
105+
EXIV2_ROOT=libexiv2/build-win-release/install
106+
CIBW_ENVIRONMENT_PASS_LINUX: EXIV2_OPTIONS
107+
CIBW_BUILD: "cp*"
108+
CIBW_SKIP: "*musllinux*"
109+
CIBW_TEST_COMMAND: >
110+
python -m exiv2 -v &&
111+
python -m unittest discover {project}/tests -v
112+
CIBW_TEST_SKIP: cp36-macosx_x86_64 cp37-macosx_x86_64
113+
CIBW_BEFORE_ALL_LINUX: >
114+
yum install -y --nogpgcheck zlib-devel expat-devel gettext-devel
115+
libcurl-devel brotli-devel meson &&
116+
localedef -c -i de_DE -f UTF-8 de_DE.UTF-8 &&
117+
pip install ninja &&
118+
cd inih && mkdir build && cd build &&
119+
meson setup --prefix=/usr --buildtype=release .. &&
120+
ninja && ninja install &&
121+
cd ../../libexiv2 &&
122+
cmake --preset linux-release $EXIV2_OPTIONS
123+
-D CONAN_AUTO_INSTALL=OFF &&
124+
cmake --build build-linux-release --config Release &&
125+
cmake --install build-linux-release --config Release
126+
127+
- name: Store results
128+
uses: actions/upload-artifact@v4
129+
with:
130+
name: exiv2-wheels-${{ runner.os }}-${{ runner.arch }}
131+
path: wheelhouse/*.whl

0 commit comments

Comments
 (0)