-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy path.gitlab-ci.yml
127 lines (121 loc) · 5.54 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
stages:
- test
- pages
- tarball
- release
variables:
TARBALL_PATH_PREFIX: ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}
TARBALL_NAME: ${TARBALL_PATH_PREFIX}.tar.xz
include:
- component: gitlab.gnome.org/GNOME/citemplates/release-service@master
inputs:
job-stage: release
dist-job-name: "tarball"
tarball-artifact-path: "${TARBALL_NAME}"
flatpak:
image: "quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master"
stage: test
tags:
- flatpak
variables:
BUNDLE: "evolution-nightly.flatpak"
MANIFEST_PATH: "data/org.gnome.Evolution.Devel.json"
FLATPAK_MODULE: "evolution"
APP_ID: "org.gnome.Evolution.Devel"
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
before_script:
- export PATH="/usr/lib/ccache:$PATH"
- export CCACHE_BASEDIR="$PWD"
- export CCACHE_DIR="$PWD/ccache"
script:
- jq -M '(.modules[] | select(.name=="evolution")).sources[0].url = env.CI_REPOSITORY_URL' ${MANIFEST_PATH} > tmp.json && mv tmp.json ${MANIFEST_PATH}
- jq -M 'del((.modules[] | select(.name=="evolution")).sources[0].branch)' ${MANIFEST_PATH} > tmp.json && mv tmp.json ${MANIFEST_PATH}
- jq -M '(.modules[] | select(.name=="evolution")).sources[0].commit = env.CI_COMMIT_SHA' ${MANIFEST_PATH} > tmp.json && mv tmp.json ${MANIFEST_PATH}
- >
xvfb-run -a -s "-screen 0 1024x768x24"
flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse flatpak_app --repo=repo --ccache ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH}
- flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
cache:
paths:
- ccache
- .flatpak-builder
artifacts:
name: "Flatpak artifacts"
expose_as: "Get Flatpak bundle here"
when: "always"
paths:
- "${BUNDLE}"
- ".flatpak-builder/build/${FLATPAK_MODULE}/evolution-config.h"
- ".flatpak-builder/build/${FLATPAK_MODULE}/CMakeFiles/CMakeError.log"
- ".flatpak-builder/build/${FLATPAK_MODULE}/CMakeFiles/CMakeOutput.log"
- ".flatpak-builder/build/${FLATPAK_MODULE}/help/"
- ".flatpak-builder/build/${FLATPAK_MODULE}/docs/reference/evolution-mail-composer/html/"
- ".flatpak-builder/build/${FLATPAK_MODULE}/docs/reference/evolution-mail-engine/html/"
- ".flatpak-builder/build/${FLATPAK_MODULE}/docs/reference/evolution-mail-formatter/html/"
- ".flatpak-builder/build/${FLATPAK_MODULE}/docs/reference/evolution-shell/html/"
- ".flatpak-builder/build/${FLATPAK_MODULE}/docs/reference/evolution-util/html/"
expire_in: 14 days
pages:
image: registry.fedoraproject.org/fedora:40
stage: pages
dependencies:
- flatpak
interruptible: false
variables:
FLATPAK_MODULE: "evolution"
script:
- |
dnf install -qy yelp-tools gcc glib2-devel
export PUBDIR=$(pwd)/public/help
export DOCSDIR=$(pwd)/public/docs
LANGLINKS=" "
mkdir -p $PUBDIR
mkdir -p $DOCSDIR
for d in ".flatpak-builder/build/${FLATPAK_MODULE}/help/"*
do
if [ -d "$d" ] && [ $(basename $d) != "CMakeFiles" ]; then
lang=$(basename $d);
cd $d
echo "Generating help for $lang"
if [ $lang == "C" ]; then
yelp-build html -o $PUBDIR .
else
mkdir $PUBDIR/$lang
yelp-build html -o $PUBDIR/$lang . -p ../C
LANGLINKS="${LANGLINKS}<a href='help/$lang/'>$lang</a> "
fi
cd $PUBDIR/../..
fi
done
gcc `pkg-config --cflags --libs glib-2.0` .gitlab-ci/update-help.c -g -O0 -o update-help
./update-help $PUBDIR
echo "Go to Evolution <a href='https://gitlab.gnome.org/GNOME/evolution/-/wikis'>Wiki pages</a> or the <a href='help/'>user documentation</a> (${LANGLINKS})<br><br>Developer documentation is <a href='docs/'>here</a>">$(pwd)/public/index.html
mkdir $(pwd)/public/YahooOAuth2
echo "Wait a bit, please...<br><br>The page URL contains an authorization code, which can be copied into the credentials prompt dialog.">$(pwd)/public/YahooOAuth2/index.html
mv ".flatpak-builder/build/${FLATPAK_MODULE}/docs/reference/evolution-mail-composer/html" $DOCSDIR/evolution-mail-composer
mv ".flatpak-builder/build/${FLATPAK_MODULE}/docs/reference/evolution-mail-engine/html" $DOCSDIR/evolution-mail-engine
mv ".flatpak-builder/build/${FLATPAK_MODULE}/docs/reference/evolution-mail-formatter/html" $DOCSDIR/evolution-mail-formatter
mv ".flatpak-builder/build/${FLATPAK_MODULE}/docs/reference/evolution-shell/html" $DOCSDIR/evolution-shell
mv ".flatpak-builder/build/${FLATPAK_MODULE}/docs/reference/evolution-util/html" $DOCSDIR/evolution-util
echo "<h4>Developer documentation for Evolution libraries</h4><a href='evolution-mail-composer'>evolution-mail-composer</a><br><a href='evolution-mail-engine'>evolution-mail-engine</a><br><a href='evolution-mail-formatter'>evolution-mail-formatter</a><br><a href='evolution-shell'>evolution-shell</a><br><a href='evolution-util'>evolution-util</a><br>" >$DOCSDIR/index.html
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
tarball:
stage: tarball
image: "quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master"
dependencies:
- flatpak
allow_failure: false
script:
- git config --global --add safe.directory `pwd`
- git archive --prefix=${TARBALL_PATH_PREFIX}/ HEAD | xz -z > ${TARBALL_NAME}
artifacts:
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
expire_in: 14 days
paths:
- "${TARBALL_NAME}"
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED