Merge pull request #358 from msink/ci-buildability

This adds AppVeyor as CI for the Windows builds.

This also lets both AppVeyor and Travis upload binary packages for tagged releases, so I don't have to keep making these myself.

The setup isn't optimal for everyone yet, but we can work that out.
This commit is contained in:
Pietro Gagliardi 2018-05-16 21:44:02 -04:00 committed by GitHub
commit 4245120f6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 161 additions and 19 deletions

72
.appveyor.yml Normal file
View File

@ -0,0 +1,72 @@
version: 'build #{build}'
environment:
matrix:
- linking: shared
compiler: msvc2013
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- linking: static
compiler: msvc2013
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- linking: shared
compiler: msvc2015
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- linking: static
compiler: msvc2015
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- linking: shared
compiler: msvc2017
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- linking: static
compiler: msvc2017
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- linking: static
compiler: mingw
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
platform:
- Win32
- x64
before_build:
- if %compiler%==msvc2013 ( set "CMAKE_GENERATOR=Visual Studio 12 2013" )
else if %compiler%==msvc2015 ( set "CMAKE_GENERATOR=Visual Studio 14 2015" )
else if %compiler%==msvc2017 ( set "CMAKE_GENERATOR=Visual Studio 15 2017" )
else if %compiler%==mingw ( set "CMAKE_GENERATOR=MinGW Makefiles" )
- if %compiler%-%platform%==mingw-Win32 ( set "PATH=C:\msys64\mingw32\bin;%PATH%" )
else if %compiler%-%platform%==mingw-x64 ( set "PATH=C:\msys64\mingw64\bin;%PATH%" )
else if %platform%==x64 ( set "CMAKE_GENERATOR=%CMAKE_GENERATOR% Win64" )
- if %linking%==static ( set CMAKE_FLAGS=-DBUILD_SHARED_LIBS=OFF )
- if %compiler%==mingw ( set "outdir=build\out" ) else ( set "outdir=build\out\Release" )
- ren "C:\Program Files\Git\usr\bin\sh.exe" _sh.exe
build_script:
- md build && cd build
- cmake -G "%CMAKE_GENERATOR%" %CMAKE_FLAGS% ..
- if %compiler%==mingw ( mingw32-make tester examples )
else ( msbuild libui.sln /t:Build /p:Configuration=Release /p:Platform=%platform% )
- cd %APPVEYOR_BUILD_FOLDER%
after_build:
- if %platform%==x64 ( set "platform=amd64" ) else ( set "platform=386" )
- if %APPVEYOR_REPO_TAG%==true ( set "version=%APPVEYOR_REPO_TAG_NAME%" )
else ( set "version=%APPVEYOR_REPO_BRANCH%" )
- set "artifact=%linking%-windows-%compiler%-%platform%-%version%"
- 7z a libui-%artifact%.zip .\%outdir%\libui.* ui.h ui_windows.h
- 7z l libui-%artifact%.zip
- 7z a examples-%artifact%.zip .\%outdir%\*.exe
- 7z l examples-%artifact%.zip
artifacts:
- path: libui-*.zip
name: libui
- path: examples-*.zip
name: examples
deploy:
provider: GitHub
artifact: libui, examples
auth_token:
secure: "2l/602m6FkqAB9TTIAkPX3Erfwg9jVTlf/Inmf2dWcbOrJJzK/WrCUIgY3B4ngly"
on:
appveyor_repo_tag: true # deploy on tag push only

View File

@ -1,23 +1,93 @@
os:
- linux
- osx
# This makes us use Ubuntu 14 instead of 12
dist: trusty
# Notes:
# - Travis uses cmake 3.0.2 on OS X; we need 3.1 or newer (thanks tbodt)
language: c language: c
include: &toolchain_linux_amd64
os: linux
dist: trusty
addons:
apt:
packages:
- libgtk-3-dev
include: &toolchain_linux_386
os: linux
dist: trusty
addons:
apt:
packages:
- gcc-multilib
- g++-multilib
- libgtk-3-dev:i386
# the rest fixes broken dependencies of libgtk:i386
- libgirepository-1.0-1:i386
- libglib2.0-dev:i386
- gir1.2-glib-2.0:i386
- gir1.2-atk-1.0:i386
- libatk1.0-dev:i386
- libfreetype6-dev:i386
- libfontconfig1-dev:i386
- libcairo2-dev:i386
- libgdk-pixbuf2.0-dev:i386
- libpango1.0-dev:i386
- libxft-dev:i386
- libpng12-dev:i386
include: &toolchain_osx_amd64
os: osx
osx_image: xcode8
# Travis CI build matrix.
# Each entry below will trigger an extra, parallel build on Travis.
matrix:
include:
- env: linking=shared platform=amd64
<<: *toolchain_linux_amd64
- env: linking=static platform=amd64
<<: *toolchain_linux_amd64
- env: linking=shared platform=386
<<: *toolchain_linux_386
- env: linking=static platform=386
<<: *toolchain_linux_386
- env: linking=shared platform=amd64
<<: *toolchain_osx_amd64
- env: linking=static platform=amd64
<<: *toolchain_osx_amd64
install:
- if [[ "${platform}" == "386" ]]; then
export CFLAGS=-m32;
export CXXFLAGS=-m32;
export PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig;
fi
- if [[ "${linking}" == "static" ]]; then
export CMAKE_FLAGS=-DBUILD_SHARED_LIBS=OFF;
fi
script: script:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libgtk-3-dev -y || sudo apt-cache search libgtk3; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
- mkdir build
- cd build
- cmake --version - cmake --version
- cmake .. -G "Unix Makefiles" - mkdir build
- make tester examples - pushd build
- rm -rf * - cmake -G "Unix Makefiles" ${CMAKE_FLAGS} ..
- cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS=OFF
- make tester examples - make tester examples
- popd
after_success:
- ls -lR build/out
- file build/out/test
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cp ui.h ui_darwin.h build/out/; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ui.h ui_unix.h build/out/; fi
- if [[ "x${TRAVIS_TAG}" != "x" ]]; then export version=${TRAVIS_TAG}; else export version=${TRAVIS_BRANCH}; fi
- export artifact=${linking}-${TRAVIS_OS_NAME}-${platform}-${version}
- pushd build/out
- tar -czvf libui-${artifact}.tgz libui.* *.h
- tar -czvf examples-${artifact}.tgz `find . -type f ! -name "*.*"`
- popd
deploy:
provider: releases
api_key:
secure: MFpee9M8kzihNg7KmQQjtznIHmfTF88EVhkY5FcM3CZUg6XfNE8YDPRLhWnH9/Oyrn1WjL37UabrJSrMYoz44s7yqyKeGK0rXIpV2i9gGMdGDxe94iCrPdvcwK2BysDd7pfwDPy1EtM8nxCQHv7d01PPT+w0hDCjBAMbILOh0IHB4yDvwyZOy6ReWas3/co3djjfjHk5XCUm54cT2mxu3U5CHQY9gsJWVaom9eINLjtDkTgbStxGSuXXmeRGzpFReR5dF4KK/IVs2GbayNfWOS8Xqhgk5uKFalWaH4P+F5ACf4zH78mhK+FiDWCkhzB6/N+mJOwl6BV9BjUv9/4+pNDQVYZvc0P19Kv8wzQsL3jMJ/SRFf4tdIeoDgRFOrq0QL7JajWq16zazbhP6PiIEfcNKdbqlvVoG7LheUsSkbVbmV439He3oykA7Tbc+dBPn+8hRdpsyoG8CyY/8nDS+E8mMxU5JvRfmlc93ZL6uxAOeIW/w8V70/upb/Tdk4d2pEeihisdL24Ys5CYzbVJAyP6Vx4y5yyKrA1RSq0pBkjzc9DJI811c4XLiLpv8jglYomN4PHk5e7GEW7n7HYSTf3gXB4HgVt5fnDudhTHErRKtzxxiBKXMYLmaCUv5mOEjSu4hRZq4v0e/VbzbfGlFoMsB9krzd9JIk7Fl1FbkNo=
file: build/out/*.tgz
file_glob: true
skip_cleanup: true
on:
tags: true