Skip to content

Build libpng <= 1.6.34 #26

Build libpng <= 1.6.34

Build libpng <= 1.6.34 #26

Workflow file for this run

name: Build libpng
on:
workflow_dispatch:
inputs:
version:
description: libpng tag to build
required: true
php:
description: PHP version to build for
required: true
stability:
description: the series stability
required: false
default: 'staging'
defaults:
run:
shell: cmd
jobs:
build:
strategy:
matrix:
arch: [x64, x86]
runs-on: windows-2019
steps:
- name: Checkout winlib-builder
uses: actions/checkout@v3
with:
path: winlib-builder
- name: Checkout libpng
uses: actions/checkout@v3
with:
path: libpng
repository: winlibs/libpng
ref: ${{github.event.inputs.version}}
- name: Compute virtual inputs
id: virtuals
run: powershell winlib-builder/scripts/compute-virtuals -version ${{github.event.inputs.php}} -arch ${{matrix.arch}}
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Fetch zlib
run: cd libpng\projects\vstudio${{steps.virtuals.outputs.vsyear}} && curl -Lo zlib1212.zip https://zlib.net/zlib1212.zip && 7z x zlib1212.zip
- name: Build dynamic libpng
run: cd libpng\projects\vstudio${{steps.virtuals.outputs.vsyear}} && msbuild vstudio.sln /t:libpng /p:Configuration=Release /p:Platform=${{steps.virtuals.outputs.msarch}} /p:PlatformToolset=${{steps.virtuals.outputs.msts}} /p:WindowsTargetPlatformVersion=${{steps.virtuals.outputs.winsdk}}
- name: Build static libpng
run: cd libpng\projects\vstudio${{steps.virtuals.outputs.vsyear}} && msbuild vstudio.sln /t:libpng "/p:Configuration=Release Library" /p:Platform=${{steps.virtuals.outputs.msarch}} /p:PlatformToolset=${{steps.virtuals.outputs.msts}} /p:WindowsTargetPlatformVersion=${{steps.virtuals.outputs.winsdk}}
- name: Install libpng
run: |
cd libpng\projects\vstudio${{steps.virtuals.outputs.vsyear}}
if "${{matrix.arch}}" == "x64" (
set objdir=x64
) else (
set objdir=.
)
xcopy %objdir%\Release\libpng.dll ..\..\..\install\bin\*
xcopy %objdir%\Release\libpng.pdb ..\..\..\install\bin\*
xcopy ..\..\png.h ..\..\..\install\include\libpng16\*
xcopy ..\..\pngconf.h ..\..\..\install\include\libpng16\*
xcopy ..\..\pnglibconf.h ..\..\..\install\include\libpng16\*
xcopy %objdir%\Release\libpng.lib ..\..\..\install\lib\*
xcopy "%objdir%\Release Library\libpng_a.*" ..\..\..\install\lib\*
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{github.event.inputs.version}}-${{steps.virtuals.outputs.vs}}-${{matrix.arch}}
path: install