Automate Windows build and deploy (with PNG support) (#379)
This commit is contained in:
66
appveyor.yml
66
appveyor.yml
@@ -1,26 +1,62 @@
|
|||||||
image: Visual Studio 2017
|
image: Visual Studio 2017
|
||||||
configuration: Release
|
configuration: Release
|
||||||
|
platform:
|
||||||
|
- Win32
|
||||||
|
- x64
|
||||||
|
|
||||||
install:
|
install:
|
||||||
## Download nasm
|
- if %PLATFORM% == Win32 (set ARCH=x86)
|
||||||
- mkdir nasm
|
- if %PLATFORM% == x64 (set ARCH=x64)
|
||||||
- cd nasm
|
## Set up nasm
|
||||||
- appveyor DownloadFile https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/win64/nasm-2.14.02-win64.zip -FileName nasm.zip
|
- choco install nasm
|
||||||
- 7z e -y nasm.zip
|
- set PATH=%PATH%;C:\Program Files\NASM
|
||||||
- set PATH=%PATH%;%CD%
|
## Set up libpng
|
||||||
## Prepare cmake
|
- cd C:\Tools\vcpkg
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
- vcpkg install libpng:%ARCH%-windows
|
||||||
- mkdir cmake_build
|
- vcpkg install libpng:%ARCH%-windows-static
|
||||||
|
|
||||||
before_build:
|
before_build:
|
||||||
|
- cd %APPVEYOR_BUILD_FOLDER%
|
||||||
|
- nasm -v
|
||||||
- cmake --version
|
- cmake --version
|
||||||
- cd cmake_build
|
- git describe --always --tags --dirty
|
||||||
- cmake .. -G "Visual Studio 15 2017" -DPNG_SUPPORTED=NO
|
- FOR /F %%a in ('git describe --always --tags --dirty') do set GIT_VERSION=%%a
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
## Build shared
|
||||||
- msbuild cmake_build\mozjpeg.sln
|
- cmake -B shared -A %PLATFORM%
|
||||||
|
-DENABLE_SHARED=1 -DENABLE_STATIC=0
|
||||||
|
-DREQUIRE_SIMD=1
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||||
|
|
||||||
|
- cmake --build shared --config Release
|
||||||
|
|
||||||
|
## Build static
|
||||||
|
- cmake -B static -A %PLATFORM%
|
||||||
|
-DENABLE_SHARED=0 -DENABLE_STATIC=1
|
||||||
|
-DREQUIRE_SIMD=1
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||||
|
-DVCPKG_TARGET_TRIPLET=%ARCH%-windows-static
|
||||||
|
|
||||||
|
- cmake --build static --config Release
|
||||||
|
|
||||||
|
after_build:
|
||||||
|
- 7z a mozjpeg-%GIT_VERSION%-win-%ARCH%.zip shared/Release static/Release
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: cmake_build\**\Release\**\*.exe
|
- path: '*.zip'
|
||||||
- path: cmake_build\**\Release\**\*.lib
|
|
||||||
|
cache:
|
||||||
|
- C:\ProgramData\chocolatey\bin
|
||||||
|
- C:\ProgramData\chocolatey\lib
|
||||||
|
- C:\Program Files\NASM
|
||||||
|
- C:\tools\vcpkg\installed
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
description: 'Automated build using Appveyor'
|
||||||
|
provider: GitHub
|
||||||
|
auth_token:
|
||||||
|
secure: UyY8O91YcxiumO2NkBUGNKDzKDSW0chVj134u+7+haPlc4Naagggt4a//7hRowjL
|
||||||
|
artifact: /.*\.zip/
|
||||||
|
on:
|
||||||
|
APPVEYOR_REPO_TAG: true # deploy on tag push only
|
||||||
|
|||||||
Reference in New Issue
Block a user