-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
200 lines (190 loc) · 3.55 KB
/
.gitlab-ci.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
194
195
196
197
198
199
200
stages:
- build
- dev_tool
- test
- deploy
#
# build
#
android:
stage: build
tags:
- android
variables:
TOXCORE_REPO: "TokTok/c-toxcore"
GL_BUILD: "android"
script:
- ./tools/build-android.sh --auto-CI
artifacts:
expire_in: 1 week
paths:
- ./uTox.ready.apk
build:linux:64:
stage: build
tags:
- linux
cache:
# keep cache across stages
key: "$CI_BUILD_REF_NAME/linux"
paths:
- cache/
variables:
TOXCORE_REPO: "TokTok/c-toxcore"
GL_BUILD: "lin64"
before_script:
- ./extra/gitlab/linux-before.sh
script:
- pkg-config --list-all | sort
- ./extra/gitlab/linux-script.sh
- cp build/utox uTox-linux-x64
artifacts:
# keep compiled files as artifacts to pass to the test stage
# remove them after one hour
expire_in: 1h
untracked: true
build:linux:muslc:
stage: build
image: alpine-tox-xvfb
tags:
- alpine-tox-xvfb
cache:
# keep cache across stages
key: "$CI_BUILD_REF_NAME/linux"
paths:
- cache/
variables:
TOXCORE_REPO: "TokTok/c-toxcore"
GL_BUILD: "linMUSL"
before_script:
- apk add freetype-dev
- apk add openal-soft-dev
- ./extra/common/filter_audio.sh
- ./extra/gitlab/linux-muslc-before.sh
script:
- ./extra/gitlab/linux-muslc-script.sh
- cp build/utox uTox-muslc-64
# TODO static build here
artifacts:
paths:
- uTox-muslc-64
expire_in: 1h
build:windows:64:
stage: build
tags:
- mingw64
cache:
paths:
- cache/
variables:
TOXCORE_REPO: "TokTok/c-toxcore"
GL_BUILD: "win64"
before_script:
- ./extra/gitlab/windows-before.sh
script:
- ./extra/gitlab/windows-script.sh
- cp build_win/utox.exe uTox-Win64.exe
artifacts:
paths:
- uTox-Win64.exe
expire_in: 6h
build:macos:
stage: build
tags:
- osx
cache:
paths:
- cache/
script:
- pwd
- docker run --rm -u $(id -u):$(id -g) -v $(pwd):/workdir -e CROSS_TRIPLE=x86_64-apple-darwin arch-build ./extra/gitlab/osx-docker.sh
- ls -la ./*
artifacts:
paths:
- utox.app/
expire_in: 6h
#
## Create development zip
#
dev_tool:windows:
stage: dev_tool
tags:
- mingw64
script:
- echo "Creating development files for windows"
- echo "Pulling headers"
- echo "Pulling libs from build:windows"
- echo "zipping folder"
- echo "archiving stuff :D"
only:
- master
- tags
- triggers
#
# test
#
.test: &test
stage: test
cache:
# keep cache across stages
key: "$CI_BUILD_REF_NAME/linux"
paths:
- cache/
dependencies:
- build:linux:64
test:chatlog:
<<: *test
script:
- cd build/tests/
- ctest -VV -R test_chatlog
test:XVFB:
stage: test
image: alpine-tox-xvfb
tags:
- alpine-tox-xvfb
cache:
key: "$CI_BUILD_REF_NAME/linux"
paths:
- cache/
dependencies:
- build:linux:muslc
script:
- Xvfb :99 &
- export DISPLAY=:99
- apk add openal-soft-dev
- ls -la
- (sleep 2m && killall uTox-muslc-64) &
- ./uTox-muslc-64 -vvvvv || true
#
## Deploy
#
deploy:main:
stage: deploy
tags:
- utox.io
script:
- echo "Deploying to live server"
environment:
name: utox.io
url: https://utox.io/
when: manual
only:
- master
deploy:nightly:
stage: deploy
tags:
- utox.io
script:
- echo "Deploying to live server"
- pwd
- ls -la
- ls -la ../
- whoami
- ls -la /srv/http/utox.io/*
environment:
name: utox.io
url: https://utox.io/nightly
when: manual
only:
- master
- develop
- deploy