Skip to content

Commit 751ce7d

Browse files
authored
Automate Windows build and deploy (with PNG support) (#379)
1 parent ffea183 commit 751ce7d

1 file changed

Lines changed: 51 additions & 15 deletions

File tree

appveyor.yml

Lines changed: 51 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,62 @@
11
image: Visual Studio 2017
22
configuration: Release
3+
platform:
4+
- Win32
5+
- x64
36

47
install:
5-
## Download nasm
6-
- mkdir nasm
7-
- cd nasm
8-
- appveyor DownloadFile https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/win64/nasm-2.14.02-win64.zip -FileName nasm.zip
9-
- 7z e -y nasm.zip
10-
- set PATH=%PATH%;%CD%
11-
## Prepare cmake
12-
- cd %APPVEYOR_BUILD_FOLDER%
13-
- mkdir cmake_build
8+
- if %PLATFORM% == Win32 (set ARCH=x86)
9+
- if %PLATFORM% == x64 (set ARCH=x64)
10+
## Set up nasm
11+
- choco install nasm
12+
- set PATH=%PATH%;C:\Program Files\NASM
13+
## Set up libpng
14+
- cd C:\Tools\vcpkg
15+
- vcpkg install libpng:%ARCH%-windows
16+
- vcpkg install libpng:%ARCH%-windows-static
1417

1518
before_build:
19+
- cd %APPVEYOR_BUILD_FOLDER%
20+
- nasm -v
1621
- cmake --version
17-
- cd cmake_build
18-
- cmake .. -G "Visual Studio 15 2017" -DPNG_SUPPORTED=NO
22+
- git describe --always --tags --dirty
23+
- FOR /F %%a in ('git describe --always --tags --dirty') do set GIT_VERSION=%%a
1924

2025
build_script:
21-
- cd %APPVEYOR_BUILD_FOLDER%
22-
- msbuild cmake_build\mozjpeg.sln
26+
## Build shared
27+
- cmake -B shared -A %PLATFORM%
28+
-DENABLE_SHARED=1 -DENABLE_STATIC=0
29+
-DREQUIRE_SIMD=1
30+
-DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
31+
32+
- cmake --build shared --config Release
33+
34+
## Build static
35+
- cmake -B static -A %PLATFORM%
36+
-DENABLE_SHARED=0 -DENABLE_STATIC=1
37+
-DREQUIRE_SIMD=1
38+
-DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
39+
-DVCPKG_TARGET_TRIPLET=%ARCH%-windows-static
40+
41+
- cmake --build static --config Release
42+
43+
after_build:
44+
- 7z a mozjpeg-%GIT_VERSION%-win-%ARCH%.zip shared/Release static/Release
2345

2446
artifacts:
25-
- path: cmake_build\**\Release\**\*.exe
26-
- path: cmake_build\**\Release\**\*.lib
47+
- path: '*.zip'
48+
49+
cache:
50+
- C:\ProgramData\chocolatey\bin
51+
- C:\ProgramData\chocolatey\lib
52+
- C:\Program Files\NASM
53+
- C:\tools\vcpkg\installed
54+
55+
deploy:
56+
description: 'Automated build using Appveyor'
57+
provider: GitHub
58+
auth_token:
59+
secure: UyY8O91YcxiumO2NkBUGNKDzKDSW0chVj134u+7+haPlc4Naagggt4a//7hRowjL
60+
artifact: /.*\.zip/
61+
on:
62+
APPVEYOR_REPO_TAG: true # deploy on tag push only

0 commit comments

Comments
 (0)