Build python-exiv2 wheels #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build python-exiv2 wheels | |
| on: workflow_dispatch | |
| jobs: | |
| build: | |
| name: build on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-22.04 | |
| - ubuntu-22.04-arm | |
| - macos-13 | |
| - macos-14 | |
| - windows-2022 | |
| include: | |
| - wget: wget | |
| - os: macos-13 | |
| arch: x86_64 | |
| target: 13.0 | |
| - os: macos-14 | |
| arch: arm64 | |
| target: 14.0 | |
| - os: windows-2022 | |
| wget: c:/msys64/usr/bin/wget.exe | |
| env: | |
| EXIV2_SRC: > | |
| https://github.com/Exiv2/exiv2/archive/refs/tags/v0.28.7.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@v4 | |
| - 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.59.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: ${{ matrix.os != 'macos-14' }} | |
| # cibuildwheel@v3.x omits Python 3.6 & 3.7 | |
| uses: pypa/cibuildwheel@v2.23.3 | |
| env: | |
| CIBW_ARCHS: auto64 | |
| 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.2.1 | |
| env: | |
| CIBW_ARCHS: auto64 | |
| 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* cp36* cp37*" | |
| 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: Store results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: exiv2-wheels-${{ runner.os }}-${{ runner.arch }} | |
| path: wheelhouse/*.whl |