forked from KhronosGroup/KTX-Software
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
193 lines (178 loc) · 5.57 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# Copyright 2015-2020 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
# CI build script for Travis.
# See https://docs.travis-ci.com/user/multi-os/ for more info.
language:
- cpp
- node_js
- java
os: linux
dist: focal
jobs:
include:
- os: linux
addons:
apt:
#sources:
# - sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- gcc-7
- g++-7
- cmake
dist: focal
env:
# NB: This must not have the fourth component of the version number.
- VULKAN_SDK_VER="1.2.176"
compiler: gcc # clang is tested by macOS build
language: python
python: '3.7'
services:
- docker
node_js:
- node
- os: osx
env:
- VULKAN_SDK_VER="1.2.176.1"
# This is just to tell the install script where to install.
- VULKAN_INSTALL_DIR="$HOME/VulkanSDK/$VULKAN_SDK_VER"
- VULKAN_SDK="$VULKAN_INSTALL_DIR/macOS"
- DEPLOY_BUILD_DIR=build-macos-universal
compiler: clang
osx_image: xcode12.4
#env:
#global:
# Phase 1: Git clone - done automatically.
# Phase 2: Install apt addons.
# Phase 3: Install cache components - Currently not using a cache
# then the following phases:
before_install:
- echo "Running on the following travis CI runner"
- uname -a
- echo "CMake version on the runner is"
- cmake --version
- eval "${MATRIX_EVAL}"
- echo -e "machine github.com\n login $GITHUB_TOKEN" >> ~/.netrc # Prevent rate limiting on Git LFS.
- cat ~/.netrc
- |
case "${TRAVIS_OS_NAME:-linux}" in
linux)
sudo apt-get update
docker run -dit --name emscripten -v $(pwd):/src emscripten/emsdk bash
;;
esac
install:
- |
case "${TRAVIS_OS_NAME:-linux}" in
linux)
./ci_scripts/install_linux.sh
;;
osx)
./ci_scripts/install_macos.sh
;;
esac
before_script:
- git fetch --unshallow --tags
- |
case "${TRAVIS_OS_NAME:-linux}" in
linux)
;;
osx)
./ci_scripts/before_build_macos.sh
;;
esac
# Make sure embedded dates are correct.
- ./install-gitconfig.sh
- rm TODO.md lib/mainpage.md pkgdoc/pages.md tools/toktx/toktx.cc
- git checkout TODO.md lib/mainpage.md pkgdoc/pages.md tools/toktx/toktx.cc
- git status
script:
- |
case "${TRAVIS_OS_NAME:-linux}" in
linux)
./ci_scripts/build_linux.sh
;;
osx)
./ci_scripts/build_macos.sh
;;
esac
# See if this helps with truncated logs.
after_script:
- sleep 10
# after_failure:
# - echo "Now uploading the failed tests"
# - ls -alsh ./tests/testimages/toktx*
# - tar -cvf failed-tests.tar ./tests/testimages/toktx*
# - curl --upload-file failed-tests.tar https://transfer.sh/toktx-failed-tests.tar
# Errors in something run in after_success: don't cause the build to fail so don't use.
before_deploy:
- |
case "${TRAVIS_OS_NAME:-linux}" in
linux)
;;
osx)
# Only notarize if we're going to deploy. I.e on a tag. Also check for access
# to signing certs to make sure we don't try this on a fork which has a tag.
#
# Although undocumented, except for a blog post, before_deploy is run for each
# deployment so we need to take steps to prevent notarization being run twice.
# https://github.com/travis-ci/travis-ci/issues/2570 about this has been open
# for years. What a crock!
if [ -n "$MACOS_CERTIFICATES_P12" -a -n "$TRAVIS_TAG" -a -z "$NOTARIZED" ]; then
./ci_scripts/notarize.sh build-macos/KTX-Software-*.pkg $APPLE_ID $DEVELOPMENT_TEAM $ALTOOL_PASSWORD; export NOTARIZED="true"
fi
if [ -z "$RELNOTES" -a -f RELEASE_NOTES.md ]; then
# Copy RELEASE_NOTES into an env. var. so we can remove lines that are
# unnecessary in the context of a GitHub release description.
RELNOTES=$(cat RELEASE_NOTES.md | awk '/^Release Notes/,/^## Version/ { next }
! /<!-- Copyright/ && ! /<!-- SPDX/ { print }')
fi
;;
esac
deploy:
- provider: pages
#edge: true # Use bleeding edge (dplv2)
skip_cleanup: true
token: $GITHUB_TOKEN # Set in the repo settings page as a secure variable
local_dir: $DEPLOY_BUILD_DIR/docs/html
on:
#branch: master
condition: $TRAVIS_OS_NAME = osx
tags: true
- provider: releases
# dpl v2 is broken. Same named but different releases are created for this
# and the deploy below. Happens even when neither of release_notes or
# release_notes_file is specified.
#edge: true # Use bleeding edge (dplv2)
token: $GITHUB_TOKEN # Set in the repo settings page as a secure variable
file_glob: true
file:
- $DEPLOY_BUILD_DIR/KTX-Software-*.pkg
# This goes to the release description so covers all versions.
# These are dpl v2 parameters.
#release_notes_file: RELEASE_NOTES.md
#release_notes: $RELNOTES
# dpl v1. Sadly this doesn't work. See https://github.com/travis-ci/dpl/issues/155.
# body: $RELNOTES
# Do release note deployment manually for now.
skip_cleanup: true
draft: true
#prerelease: true
on:
tags: true
#branch: master
condition: $TRAVIS_OS_NAME = osx
- provider: releases
#edge: true # Use bleeding edge (dplv2)
token: $GITHUB_TOKEN # Set in the repo settings page as a secure variable
file_glob: true
file:
- build/linux-release/KTX-Software-*-Linux.*
- build/web-release/KTX-Software-*-Web-*
skip_cleanup: true
draft: true
#prerelease: true
on:
tags: true
#branch: master
condition: $TRAVIS_OS_NAME = linux
# vim:ai:ts=4:sts=2:sw=2:expandtab