Repository navigation
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
210 lines (198 loc) · 6.58 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
210 lines (198 loc) · 6.58 KB
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
include:
- project: "gnome/citemplates"
file: "flatpak/flatpak_ci_initiative.yml"
- component: gitlab.gnome.org/GNOME/citemplates/release-service@master
inputs:
dist-job-name: "flatpak"
stages:
- check
- test
- build
- deploy
- release
flatpak:
extends: .flatpak
stage: build
variables:
MANIFEST_PATH: "build-aux/org.gnome.Meld.Devel.json"
FLATPAK_MODULE: "meld"
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
APP_ID: "org.gnome.Meld.Devel"
BUNDLE: "meld-dev.flatpak"
nightly:
extends: '.publish_nightly'
needs:
- 'flatpak'
.pythonchecks:
stage: check
image: registry.fedoraproject.org/fedora:latest
needs: []
variables:
PRE_COMMIT_HOME: $CI_PROJECT_DIR/.cache/pre-commit
UV_CACHE_DIR: $CI_PROJECT_DIR/.cache/uv
cache:
key:
files:
- pyproject.toml
- .pre-commit-config.yaml
paths:
- .cache/
before_script:
- dnf install -y git gtk4 gtksourceview5 libadwaita python3-cairo python3-gobject-base uv
- uv venv --system-site-packages
- uv pip install --group dev
lint:
extends: .pythonchecks
script:
- uv run --no-sync pre-commit run --all-files --show-diff-on-failure
pytest:
extends: .pythonchecks
script:
- uv run --no-sync pytest
mingw-dist:
stage: build
needs: []
variables:
DESTDIR: install-tree
MSYSTEM: "UCRT64"
PKG_PREFIX: "mingw-w64-ucrt-x86_64"
CHERE_INVOKING: "yes"
tags: # select gitlab runners with specific tag (unrelated to git repo tags)
- win32-ps
artifacts:
name: "${env:CI_JOB_STAGE}-${env:CI_COMMIT_REF_NAME}"
paths:
- meld-*.exe
before_script:
- $env:Path = "C:\msys64\${env:MSYSTEM}\bin;C:\msys64\usr\bin;${env:PATH}"
- >
C:\msys64\usr\bin\pacman --noconfirm -S --refresh --sysupgrade --needed
${env:PKG_PREFIX}-adwaita-icon-theme
${env:PKG_PREFIX}-appstream
${env:PKG_PREFIX}-desktop-file-utils
${env:PKG_PREFIX}-gettext
${env:PKG_PREFIX}-glib2
${env:PKG_PREFIX}-gsettings-desktop-schemas
${env:PKG_PREFIX}-gtk-update-icon-cache
${env:PKG_PREFIX}-gtk4
${env:PKG_PREFIX}-gtksourceview5
${env:PKG_PREFIX}-itstool
${env:PKG_PREFIX}-libadwaita
${env:PKG_PREFIX}-meson
${env:PKG_PREFIX}-nsis
${env:PKG_PREFIX}-pyinstaller
${env:PKG_PREFIX}-python-gobject
${env:PKG_PREFIX}-python-lxml
${env:PKG_PREFIX}-python-markupsafe
${env:PKG_PREFIX}-python-pip
${env:PKG_PREFIX}-python-pytest
${env:PKG_PREFIX}-python-pyaml
glib2-devel
intltool
- pip install pyinstaller-versionfile
script:
- meson setup --prefix=/ . meson-build/
- meson compile -v -C meson-build/
- meson install -C meson-build/ --destdir=pyinstaller-build/
# In a local environment, there is an extra msys64/ path element on the
# end here that is missing in gitlab CI.
- cp windows/meld.spec meson-build/pyinstaller-build
- cd meson-build/pyinstaller-build
- pyinstaller ./meld.spec
- cp version.nsh dist/
- cp ../../windows/meld.nsis dist/
- cd dist
- makensis ./meld.nsis
- mv meld-*.exe ../../..
# main purpose of this job is creating installers and not checking for breakage by changes in code
# so allow failures since the status of the build may depend on updates of rolling-release msys2 packages
allow_failure: true
macos:
stage: build
needs: []
tags:
- macos
- arm64
cache:
- key: ccache
paths:
- ccache
variables:
CCACHE_DIR: $CI_PROJECT_DIR/ccache
CCACHE_MAXSIZE: "300Mi"
PACKAGE_REGISTRY_URL: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic
MM_REPO_URL: https://gitlab.com/dehesselle/meld_macos.git
MM_REPO_REF: cf0d881d2bfdc1607f0e2bd11bcd9bd215e74f1b
MELD_BUILD: $CI_PIPELINE_IID
REP_DIR: $CI_PROJECT_DIR
SDKROOT: /opt/sdks/MacOSX11.3.sdk
script:
# Clone the repo containing all the build scripts.
- |
git clone $MM_REPO_URL mm
git -C mm checkout $MM_REPO_REF
git -C mm submodule update --recursive --init
# Build the dependencies and then Meld. Dependencies are uploaded to the
# package registry so they don't have to be rebuilt every time if there
# haven't been any changes. Changes to dependencies are detected by
# checksumming all the files and using that checksum as a version number.
- |
echo $CI_PROJECT_DIR > mm/ci_project_dir.txt
MM_SHA=$(LANG=C find -s mm -type f -not -wholename '*.git/*' -exec cat {} \+ | shasum | awk '{ print $1 }')
VER_DIR=$(mm/jhb/usr/bin/config get VER_DIR)
PACKAGE_URL=${PACKAGE_REGISTRY_URL}/dependencies/${MM_SHA}/$(basename $VER_DIR)_$(uname -m).dmg
if ! curl -H "JOB-TOKEN: $CI_JOB_TOKEN" -fLO $PACKAGE_URL; then
mm/build_toolset.sh
mm/jhb/usr/bin/jhb run rustup self uninstall -y || true
mm/jhb/usr/bin/archive remove_nonessentials
mm/jhb/usr/bin/archive create_dmg
curl --fail-with-body -H "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file $(basename $PACKAGE_URL) $PACKAGE_URL
rm -rf ${VER_DIR:?}
fi
- mm/jhb/usr/bin/archive install_dmg
- mm/build_meld.sh
after_script:
- mm/jhb/usr/bin/archive uninstall_dmg
artifacts:
paths:
- Meld*.dmg
.release-asset:
stage: release
image: registry.fedoraproject.org/fedora:latest
variables:
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/meld/${CI_COMMIT_TAG}"
RELEASE_LINKS_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/${CI_COMMIT_TAG}/assets/links"
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED
script:
- artifact=$(ls $ARTIFACT_GLOB)
# Get rid of the pipeline ID in the filename (only affects macOS)
- filename=$(echo "$artifact" | sed -E 's/\+[0-9]+//; s/_/-/')
# Upload to the generic package registry, and attach to the release
- >
curl --fail-with-body --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "$artifact" "${PACKAGE_REGISTRY_URL}/${filename}"
- |
curl --fail-with-body --json @- "$RELEASE_LINKS_URL" --header "JOB-TOKEN: ${CI_JOB_TOKEN}" <<EOF
{
"name": "${LABEL}",
"url": "${PACKAGE_REGISTRY_URL}/${filename}",
"direct_asset_path": "/binaries/${filename}",
"link_type": "package"
}
EOF
release-asset-windows:
extends: .release-asset
needs:
- release-service
- mingw-dist
variables:
ARTIFACT_GLOB: "meld-*.exe"
LABEL: "Windows installer"
release-asset-macos:
extends: .release-asset
needs:
- release-service
- macos
variables:
ARTIFACT_GLOB: "Meld*.dmg"
LABEL: "macOS image"