forked from FreeCAD/FreeCAD-Bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml.tmp
115 lines (109 loc) · 4.74 KB
/
.travis.yml.tmp
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
env:
global:
# tag
- DEPLOY_RELEASE="0.19_pre"
- OSX_PORTS_CACHE=${OSX_PORTS_CACHE:-FreeCAD/FreeCAD-ports-cache}
- OSX_PORTS_CACHE_BRANCHE="master"
- DEPLOY_REPO=${DEPLOY_REPO:-FreeCAD/FreeCAD}
- DEPLOY=${DEPLOY:-0}
os:
- linux
- osx
- windows
compiler: gcc
language: cpp
before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-get update -qq && sudo apt-get install -y desktop-file-utils jq zsync;
apt-get download libc6;
dpkg -x libc6*.deb libc6;
fi
# https://travis-ci.community/t/syntax-error-unexpected-keyword-rescue-expecting-keyword-end-in-homebrew/5623
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update;
fi
install:
- eval "$(curl -fsSL "https://raw.githubusercontent.com/${OSX_PORTS_CACHE}/${OSX_PORTS_CACHE_BRANCHE}/travis-helpers.sh")"
- # Temp patch
- |
gitHub_release_named()
{
namedReleaseAsJSON=$(gitHub_releases ${1} | jq -r --arg releaseName ${2-$release} '.[] | select(.tag_name==$releaseName)')
echo ${namedReleaseAsJSON}
}
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
curl -LO https://raw.githubusercontent.com/AppImage/AppImages/master/pkg2appimage;
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage";
chmod a+x appimagetool-x86_64.AppImage;
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda;
. $HOME/miniconda/etc/profile.d/conda.sh;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda;
. $HOME/miniconda/etc/profile.d/conda.sh;
fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
wget https://repo.anaconda.com/pkgs/misc/conda-execs/conda-latest-win-64.exe -O conda.exe --no-check-certificate;
cmd.exe //C 'conda.exe create -y -q -p C:\conda conda conda-build=3.18.10 conda-verify python=3.7 -c conda-forge';
cmd.exe //C 'call C:\conda\Scripts\activate';
fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then
hash -r;
conda init bash;
conda activate base;
conda config --set always_yes yes --set changeps1 no;
conda update -q --all;
conda install p7zip sed -y -c conda-forge;
fi
- wget "https://github.com/FreeCAD/FreeCAD/releases/download/0.18/FreeCAD.0_18.Offline.Doc.7z"
- 7z x FreeCAD.0_18.Offline.Doc.7z
script:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
cd conda/linux;
bash ./create_bundle.sh;
cd ..;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
cd conda/osx;
bash ./create_bundle.sh;
cd ..;
fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
cp conda.exe conda/win;
cd conda/win;
cmd.exe //C 'create_bundle.bat';
cd ..;
fi
after_success:
- |
if [ "$TRAVIS_OS_NAME" == "linux" -a "${DEPLOY}" == "1" ]; then
export deployContext=$(create_helper_context repo=${DEPLOY_REPO} auth_token=${GH_TOKEN} release=${DEPLOY_RELEASE})
gitHub_prune_assets_for_release_named $deployContext ".AppImage" 0
export DEPLOYMENT_ARCHIVE=$(ls linux/*.AppImage)
gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
export DEPLOYMENT_ARCHIVE=$(ls linux/*.AppImage.zsync)
gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
export DEPLOYMENT_ARCHIVE=$(ls linux/*.AppImage-SHA256.txt)
gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
fi
- |
if [ "$TRAVIS_OS_NAME" == "osx" -a "${DEPLOY}" == "1" ]; then
export deployContext=$(create_helper_context repo=${DEPLOY_REPO} auth_token=${GH_TOKEN} release=${DEPLOY_RELEASE})
gitHub_prune_assets_for_release_named $deployContext ".dmg" 0
export DEPLOYMENT_ARCHIVE=$(ls osx/*.dmg)
gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
export DEPLOYMENT_ARCHIVE=$(ls osx/*.dmg-SHA256.txt)
gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
fi
- |
if [ "$TRAVIS_OS_NAME" == "windows" -a "${DEPLOY}" == "1" ]; then
export deployContext=$(create_helper_context repo=${DEPLOY_REPO} auth_token=${GH_TOKEN} release=${DEPLOY_RELEASE})
gitHub_prune_assets_for_release_named $deployContext "x86_64.7z" 0
gitHub_prune_assets_for_release_named $deployContext "x86_64.7z-SHA256.txt" 0
export DEPLOYMENT_ARCHIVE=$(ls win/*x86_64.7z)
gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
export DEPLOYMENT_ARCHIVE=$(ls win/*x86_64.7z-SHA256.txt)
gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
fi