-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
290 lines (262 loc) · 7.63 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
include:
- remote: 'https://gitlab.gnome.org/Infrastructure/freedesktop-ci-templates/-/raw/145b1bc7ef1702d2bd71584010d7113c6786a506/templates/fedora.yml'
- remote: 'https://gitlab.gnome.org/Infrastructure/freedesktop-ci-templates/-/raw/145b1bc7ef1702d2bd71584010d7113c6786a506/templates/ubuntu.yml'
- remote: 'https://gitlab.gnome.org/Infrastructure/freedesktop-ci-templates/-/raw/145b1bc7ef1702d2bd71584010d7113c6786a506/templates/ci-fairy.yml'
- component: gitlab.gnome.org/GNOME/citemplates/release-service@master
inputs:
job-stage: deploy
dist-job-name: "dist-xdg-desktop-portal-gnome-tarball"
tarball-artifact-path: $TARBALL_ARTIFACT_PATH
stages:
- review
- prepare
- build
- deploy
variables:
FDO_UPSTREAM_REPO: GNOME/xdg-desktop-portal-gnome
TARBALL_ARTIFACT_PATH: build/meson-dist/$CI_PROJECT_NAME-$CI_COMMIT_TAG.tar.xz
default:
interruptible: true
workflow:
rules:
# Allow to switch from branch pipelines to MR pipelines seamlessly
# https://docs.gitlab.com/ee/ci/jobs/job_control.html#avoid-duplicate-pipelines
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
when: never
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Don't trigger a branch pipeline if there is an open MR
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: '$CI_COMMIT_BRANCH'
- if: '$CI_COMMIT_TAG'
.skip-git-clone:
variables:
GIT_STRATEGY: none
.only-merge-requests:
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^$/'
when: never
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
when: on_success
.pipeline-guard:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_BRANCH =~ /^gnome-[0-9-]+$/'
# Avoid catchall `when: manual` rule which might
# cause duplicate pipelines to be triggered.
# https://docs.gitlab.com/ee/ci/jobs/job_control.html#avoid-duplicate-pipelines
#
# Also make it so pipelines without MR need to be started
# manually, since their state will most likely be WIP
- if: '$CI_COMMIT_BRANCH'
when: 'manual'
repo-sanity:
extends:
- .fdo.ci-fairy
stage: review
variables:
GIT_DEPTH: "1"
script:
- >
if [[ -z "$CI_REGISTRY_IMAGE" ]] ;
then
.gitlab-ci/simple-junit-report.sh check-junit-report.xml \
repo-sanity "The container registry should be enabled in the project general settings panel at $CI_PROJECT_URL/edit" ;
exit 1 ;
fi
artifacts:
expire_in: 1 week
paths:
- check-junit-report.xml
reports:
junit: check-junit-report.xml
rules:
- !reference [.only-merge-requests, rules]
check-merge-request:
extends:
- .fdo.ci-fairy
- .skip-git-clone
stage: review
script:
ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request-report.xml
artifacts:
expire_in: 1 week
paths:
- check-merge-request-report.xml
reports:
junit: check-merge-request-report.xml
rules:
- !reference [.only-merge-requests, rules]
.container-common:
variables:
FDO_DISTRIBUTION_TAG: '2025-01-20.1'
.fedora-container:
extends:
- .container-common
variables:
FDO_DISTRIBUTION_VERSION: 40
FDO_DISTRIBUTION_PACKAGES:
bubblewrap
fontconfig-devel
fuse3-devel
gcc
gettext-devel
git
glib2-devel
gnome-desktop4-devel
gsettings-desktop-schemas-devel
gstreamer1-plugins-base-devel
gstreamer1-plugins-good
gtk4-devel
json-glib-devel
libadwaita-devel
libseccomp-devel
libudev-devel
libxkbcommon-devel
meson
pipewire-devel
python3-pytest
python3-pytest-xdist
python3-dbusmock
python3-dbus
sassc
systemd-devel
umockdev-devel
wayland-devel
xkeyboard-config-devel
'dnf-command(builddep)'
FDO_DISTRIBUTION_EXEC: |
dnf builddep gtk4 -y
./.gitlab-ci/install-meson-project.sh \
https://github.com/flatpak/xdg-desktop-portal.git \
1.19.1 .
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas.git \
master . 8df894aecbf6908c48c3da62434061bfa8dc46ea
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/GNOME/gtk.git \
4.17.3 .
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/GNOME/libadwaita.git \
1.7.alpha .
.ubuntu-container:
extends:
- .container-common
variables:
FDO_DISTRIBUTION_VERSION: '23.10'
FDO_DISTRIBUTION_PACKAGES:
bubblewrap
ca-certificates
gcc
git
gsettings-desktop-schemas-dev
libfuse3-dev
libgtk-4-dev
libjson-glib-dev
libgstreamer-plugins-base1.0-dev
gstreamer1.0-plugins-good
libgstreamer-plugins-good1.0-dev
libpipewire-0.3-dev
libudev-dev
libumockdev-dev
libseccomp-dev
libsystemd-dev
libwayland-dev
libxkbcommon-dev
meson
python3-pytest
python3-pytest-xdist
python3-dbusmock
python3-dbus
sassc
FDO_DISTRIBUTION_EXEC: |
sed -i '/deb-src/s/^# //' /etc/apt/sources.list &&
./.gitlab-ci/install-meson-project.sh \
https://github.com/flatpak/xdg-desktop-portal.git \
1.19.1 .
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas.git \
master . 8df894aecbf6908c48c3da62434061bfa8dc46ea
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/GNOME/libadwaita.git \
1.7.alpha .
prepare-fedora:
extends:
- .fdo.container-build@fedora
- .fedora-container
- .skip-git-clone
stage: prepare
rules:
- !reference [.pipeline-guard, rules]
prepare-ubuntu:
extends:
- .fdo.container-build@ubuntu
- .ubuntu-container
- .skip-git-clone
stage: prepare
rules:
- !reference [.pipeline-guard, rules]
when: manual
.build-common:
stage: build
script:
- meson setup --wrap-mode=nofallback --force-fallback-for=libgxdp _build .
- meson compile -C _build
- meson install -C _build
build-fedora:
extends:
- .fdo.distribution-image@fedora
- .fedora-container
- .build-common
needs:
- job: prepare-fedora
artifacts: false
build-ubuntu:
extends:
- .fdo.distribution-image@ubuntu
- .ubuntu-container
- .build-common
needs:
- job: prepare-ubuntu
artifacts: false
dist-xdg-desktop-portal-gnome:
extends:
- .fdo.distribution-image@fedora
- .fedora-container
stage: deploy
needs:
- job: build-fedora
artifacts: false
script:
- meson setup --wrap-mode=nofallback build .
- meson dist -C build --include-subprojects
artifacts:
expire_in: 7 day
name: "xdg-desktop-portal-gnome-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- build/meson-private/dist-build/meson-logs
rules:
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
when: manual
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- "**/meson.build"
- meson/*
when: on_success
- if: '$GITLAB_USER_LOGIN == "marge-bot"'
when: on_success
- if: '$CI_MERGE_REQUEST_ASSIGNEES == "marge-bot"'
when: on_success
dist-xdg-desktop-portal-gnome-tarball:
extends: dist-xdg-desktop-portal-gnome
artifacts:
expose_as: 'Get tarball here'
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- $TARBALL_ARTIFACT_PATH
rules:
- if: '$CI_COMMIT_TAG'