-
Notifications
You must be signed in to change notification settings - Fork 269
/
.gitlab-ci.yml
137 lines (125 loc) · 4.76 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
include: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml'
variables:
GNOME_SDK: 42
image: quay.io/gnome_infrastructure/gnome-runtime-images:gnome-${GNOME_SDK}
stages:
- check
- test
- build
- deploy
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'
dependencies:
- 'flatpak'
.pythonchecks:
stage: check
image: registry.fedoraproject.org/fedora:latest
script:
- dnf install -y git glib2 gtk3 gtksourceview4 python3-cairo python3-pip python3-gobject-base
- pip3 install -r dev-requirements.txt
- $PYTHON_CHECK_COMMAND
.pythonflatpak:
stage: check
tags: # test in the same org.gnome.Sdk environment that is used for creating flatpaks
- flatpak
script:
- flatpak run --share=network --filesystem=`pwd` --env=PATH=$PATH:/var/data/python/bin --command=sh org.gnome.Sdk -c 'pip3 install --user -r dev-requirements.txt; $PYTHON_CHECK_COMMAND'
lint:
extends: .pythonchecks
variables:
PYTHON_CHECK_COMMAND: "pre-commit run --all-files --show-diff-on-failure"
pytest:
extends: .pythonchecks
variables:
PYTHON_CHECK_COMMAND: "pytest"
mingw64-dist:
stage: build
variables:
MSYS2_ARCH: "x86_64"
MSYSTEM: "MINGW64"
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:
- dist/
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
mingw-w64-${env:MSYS2_ARCH}-adwaita-icon-theme
mingw-w64-${env:MSYS2_ARCH}-gsettings-desktop-schemas
mingw-w64-${env:MSYS2_ARCH}-gtk-update-icon-cache
mingw-w64-${env:MSYS2_ARCH}-gtk3
mingw-w64-${env:MSYS2_ARCH}-gtksourceview4
mingw-w64-${env:MSYS2_ARCH}-python-cx-freeze
mingw-w64-${env:MSYS2_ARCH}-python-gobject
mingw-w64-${env:MSYS2_ARCH}-python-pytest
mingw-w64-${env:MSYS2_ARCH}-python-setuptools
glib2-devel
intltool
script:
- glib-compile-schemas data
- python3 setup_win32.py bdist_dumb --bdist-dir build\bdist.mingw\msi --keep-temp bdist_msi --keep-temp
# 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:
rules:
# Do not run in forks as the runner is not available there.
# (except for dehesselle who maintains the runner)
- if: $CI_PROJECT_NAMESPACE == "GNOME" || $CI_PROJECT_NAMESPACE == "dehesselle"
stage: build
tags:
- macos
- arm64
variables:
CCACHE_DIR: /Users/Shared/work/ccache
MM_REPO_URL: https://gitlab.com/dehesselle/meld_macos.git
MM_REPO_REF: 40a3e6b090650de6fcf3e684fc7dac527b4e9310
MELD_BUILD: $CI_PIPELINE_IID
REP_DIR: $CI_PROJECT_DIR
SDKROOT: /opt/sdks/MacOSX11.3.sdk
WRK_DIR: $CI_PROJECT_DIR
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=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/dependencies/${MM_SHA}/$(basename $VER_DIR)_$(uname -m).dmg
if ! curl -H "JOB-TOKEN: $CI_JOB_TOKEN" -fLO $PACKAGE_URL; then
export FORCE_BUILD_FROM_SOURCE=true
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:?}
unset FORCE_BUILD_FROM_SOURCE
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