Version 1.6.42, built against zlib 1.3.1. #17
This file contains 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: libpng | |
on: [push, pull_request] | |
# Cancel in-progress builds on push to same branch / PR | |
# https://stackoverflow.com/a/72408109 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
ZLIB_VERSION: 1.3.1 | |
PNG_VERSION: 1.6.42 | |
jobs: | |
windows: | |
name: ${{ matrix.os }}${{ matrix.env.SUFFIX }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: windows-2019 | |
env: | |
COMPILER: -DCMAKE_C_COMPILER=cl.exe | |
SUFFIX: | |
- os: windows-2019 | |
env: | |
COMPILER: -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/Llvm/bin/clang-cl.exe" -DCMAKE_LINKER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/Llvm/bin/lld-link.exe" -DCMAKE_C_FLAGS="-m64 /EHsc" | |
SUFFIX: -clang-cl | |
steps: | |
- name: Install Ninja | |
uses: seanmiddleditch/gha-setup-ninja@v3 | |
- name: Set up Visual Studio environment | |
uses: seanmiddleditch/gha-setup-vsdevenv@v3 | |
- name: Fetch prebuilt zlib | |
run: | | |
mkdir deps | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/zlib-${{ env.ZLIB_VERSION }}-${{ matrix.os }}.zip -OutFile zlib.zip | |
unzip zlib.zip | |
- name: Clone libpng | |
uses: actions/checkout@v2 | |
with: | |
repository: glennrp/libpng | |
ref: v${{ env.PNG_VERSION }} | |
path: libpng | |
- name: Build & install | |
run: | | |
cmake ^ | |
${{ env.COMPILER }} ^ | |
-DCMAKE_BUILD_TYPE=Release ^ | |
-DCMAKE_PREFIX_PATH=%CD:\=/%/deps ^ | |
-DCMAKE_INSTALL_PREFIX=%CD:\=/%/install ^ | |
-DPNG_EXECUTABLES=OFF ^ | |
-DPNG_SHARED=OFF ^ | |
-DPNG_TESTS=OFF ^ | |
-DSKIP_INSTALL_FILES=ON ^ | |
-G Ninja -S libpng -B libpng-build | |
ninja -C libpng-build install | |
shell: cmd | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: libpng-${{ env.PNG_VERSION }}-${{ matrix.os }}${{ matrix.env.SUFFIX }} | |
path: install | |
windows-mingw: | |
name: windows-mingw | |
runs-on: windows-2019 | |
steps: | |
- name: Install Ninja | |
uses: seanmiddleditch/gha-setup-ninja@v3 | |
- name: Set up MinGW environment | |
uses: msys2/setup-msys2@v2 | |
- name: Fetch prebuilt zlib | |
run: | | |
mkdir deps | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/zlib-${{ env.ZLIB_VERSION }}-windows-mingw.zip -O zlib.zip | |
unzip zlib.zip | |
- name: Clone libpng | |
uses: actions/checkout@v2 | |
with: | |
repository: glennrp/libpng | |
ref: v${{ env.PNG_VERSION }} | |
path: libpng | |
- name: Build & install | |
run: | | |
cmake ^ | |
-DCMAKE_C_COMPILER=gcc.exe ^ | |
-DCMAKE_BUILD_TYPE=Release ^ | |
-DCMAKE_PREFIX_PATH=%CD:\=/%/deps ^ | |
-DCMAKE_INSTALL_PREFIX=%CD:\=/%/install ^ | |
-DPNG_EXECUTABLES=OFF ^ | |
-DPNG_SHARED=OFF ^ | |
-DPNG_TESTS=OFF ^ | |
-DSKIP_INSTALL_FILES=ON ^ | |
-G Ninja -S libpng -B libpng-build | |
ninja -C libpng-build install/strip | |
shell: cmd | |
- name: Remove useless pkgconfig crap | |
shell: cmd | |
run: | | |
cd install | |
del bin /s /q | |
rmdir bin /s /q | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: libpng-${{ env.PNG_VERSION }}-windows-mingw | |
path: install | |
ubuntu: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.runs-on }} | |
container: ${{ matrix.container }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-18.04 | |
runs-on: ubuntu-latest | |
container: ubuntu:bionic-20220427 | |
steps: | |
- name: Install base build tools | |
run: | | |
apt update | |
apt install -y ninja-build cmake g++ wget unzip | |
mkdir -p deps | |
- name: Fetch prebuilt zlib | |
run: | | |
mkdir -p deps && cd deps | |
wget https://ci.magnum.graphics/zlib-${{ env.ZLIB_VERSION }}-${{ matrix.os }}.zip | |
unzip zlib-${{ env.ZLIB_VERSION }}-${{ matrix.os }}.zip | |
- name: Clone libpng | |
uses: actions/checkout@v3 | |
with: | |
repository: glennrp/libpng | |
ref: v${{ env.PNG_VERSION }} | |
path: libpng | |
- name: Build & install | |
run: | | |
mkdir build && cd build | |
cmake ../libpng \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_PREFIX_PATH=$(pwd)/../deps \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \ | |
-DPNG_EXECUTABLES=OFF \ | |
-DPNG_SHARED=OFF \ | |
-DPNG_TESTS=OFF \ | |
-DSKIP_INSTALL_FILES=ON \ | |
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | |
-G Ninja | |
ninja install/strip | |
- name: Remove useless pkgconfig crap | |
run: | | |
rm -r install/bin | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: libpng-${{ env.PNG_VERSION }}-${{ matrix.os }} | |
path: install |