-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
182 lines (164 loc) · 7.13 KB
/
.gitlab-ci.yml
File metadata and controls
182 lines (164 loc) · 7.13 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
image: registry.melroy.org/melroy/docker-images/gtk-cmake-ninja:trixie
stages:
- test
- build
- deploy
variables:
GIT_SUBMODULE_STRATEGY: recursive
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/libreweb-browser/${CI_COMMIT_TAG}"
RELEASE_LINKS_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/${CI_COMMIT_TAG}/assets/links"
include:
- template: Security/SAST.gitlab-ci.yml
# Linux build template (debs only)
.build_template: &build_definition
stage: build
rules:
- if: $CI_PROJECT_NAMESPACE == "libreweb" && $CI_COMMIT_TAG
script:
- ./scripts/build-lnx-prod.sh "DEB"
artifacts:
name: Packages
expire_in: 4 weeks
paths:
- build_prod/libreweb-browser-*.deb
unit_test:
stage: test
interruptible: true
script: ./scripts/run-tests.sh
static_code_analysis:
stage: test
interruptible: true
script: ./scripts/cpp-check.sh
code_style_guidelines:
stage: test
interruptible: true
script: ./scripts/check-format.sh
sast:
stage: test
interruptible: true
variables:
SAST_EXCLUDED_PATHS: "lib"
SAST_EXCLUDED_ANALYZERS: "bandit,brakeman,eslint,gosec,kubesec,nodejs-scan,phpcs-security-audit,pmd-apex,security-code-scan,sobelow,spotbugs"
SEARCH_MAX_DEPTH: 3
doxygen:
stage: build
interruptible: true
script:
- ./scripts/build-docs.sh
artifacts:
name: Doxygen
paths:
- build_docs/docs/html/
# Build trixie (deb + rpm + source archive)
build:trixie:
stage: build
script:
- ./scripts/build-lnx-prod.sh "TGZ;DEB;RPM"
- ./scripts/create-source-archive.sh
artifacts:
name: Packages
expire_in: 4 weeks
paths:
- build_prod/libreweb-browser-*.deb
- build_prod/libreweb-browser-*.rpm
- build_prod/libreweb-browser-*.tar.gz
- build_prod/libreweb-browser-source-*.tar.gz
# Bookworm (debian)
build:bookworm:
image: registry.melroy.org/melroy/docker-images/gtk-cmake-ninja:bookworm
<<: *build_definition
# Forky (debian)
build:forky:
image: registry.melroy.org/melroy/docker-images/gtk-cmake-ninja:forky
<<: *build_definition
# Noble (ubuntu)
build:noble:
image: registry.melroy.org/melroy/docker-images/gtk-cmake-ninja:noble
<<: *build_definition
# Plucky (ubuntu)
build:plucky:
image: registry.melroy.org/melroy/docker-images/gtk-cmake-ninja:plucky
<<: *build_definition
# Upload artifacts & Create new release
upload_and_release:
stage: deploy
image: curlimages/curl:latest
rules:
- if: $CI_PROJECT_NAMESPACE == "libreweb" && $CI_COMMIT_TAG
variables:
PROJECT_NAME: "LibreWeb Browser"
PACKAGE_NAME: "libreweb-browser"
script:
# All the different deb packages
# Debian based
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN"
--upload-file build_prod/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-bookworm.deb
${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-bookworm.deb'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN"
--upload-file build_prod/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-trixie.deb
${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-trixie.deb'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN"
--upload-file build_prod/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-forky.deb
${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-forky.deb'
# Ubuntu based
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN"
--upload-file build_prod/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-noble.deb
${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-noble.deb'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN"
--upload-file build_prod/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-plucky.deb
${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-plucky.deb'
# Remaining packages (RPM, tar.gz, etc.)
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN"
--upload-file build_prod/${PACKAGE_NAME}-v${CI_COMMIT_TAG}.rpm
${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}.rpm'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN"
--upload-file build_prod/${PACKAGE_NAME}-v${CI_COMMIT_TAG}.tar.gz
${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}.tar.gz'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN"
--upload-file build_prod/${PACKAGE_NAME}-source-v${CI_COMMIT_TAG}.tar.gz
${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-source-v${CI_COMMIT_TAG}.tar.gz'
# Create links
# !! In the reverse order of how we want the links to be displayed !!
# Meaning the first added, will be the displayed last.
- 'curl --request POST
--header "JOB-TOKEN: $CI_JOB_TOKEN"
--header "Content-Type: application/json"
--data "{\"name\":\"${PROJECT_NAME} - Source Code Archive (.tar.gz)\",\"url\":\"${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-source-v${CI_COMMIT_TAG}.tar.gz\",\"link_type\":\"other\"}"
${RELEASE_LINKS_URL}'
- 'curl --request POST
--header "JOB-TOKEN: $CI_JOB_TOKEN"
--header "Content-Type: application/json"
--data "{\"name\":\"${PROJECT_NAME} - Compressed Binary (.tar.gz)\",\"url\":\"${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}.tar.gz\",\"link_type\":\"package\"}"
${RELEASE_LINKS_URL}'
- 'curl --request POST
--header "JOB-TOKEN: $CI_JOB_TOKEN"
--header "Content-Type: application/json"
--data "{\"name\":\"${PROJECT_NAME} - Fedora/openSUSE/CentOS (.rpm)\",\"url\":\"${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}.rpm\",\"link_type\":\"package\"}"
${RELEASE_LINKS_URL}'
# Deb package links
- 'curl --request POST
--header "JOB-TOKEN: $CI_JOB_TOKEN"
--header "Content-Type: application/json"
--data "{\"name\":\"${PROJECT_NAME} - Debian 12 Bookworm/MX Linux 23 (.deb)\",\"url\":\"${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-bookworm.deb\",\"link_type\":\"package\"}"
${RELEASE_LINKS_URL}'
- 'curl --request POST
--header "JOB-TOKEN: $CI_JOB_TOKEN"
--header "Content-Type: application/json"
--data "{\"name\":\"${PROJECT_NAME} - Debian 13 Trixie/MX Linux 25 (.deb)\",\"url\":\"${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-trixie.deb\",\"link_type\":\"package\"}"
${RELEASE_LINKS_URL}'
- 'curl --request POST
--header "JOB-TOKEN: $CI_JOB_TOKEN"
--header "Content-Type: application/json"
--data "{\"name\":\"${PROJECT_NAME} - Debian 14 Forky/Kali Linux (.deb)\",\"url\":\"${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-forky.deb\",\"link_type\":\"package\"}"
${RELEASE_LINKS_URL}'
- 'curl --request POST
--header "JOB-TOKEN: $CI_JOB_TOKEN"
--header "Content-Type: application/json"
--data "{\"name\":\"${PROJECT_NAME} - Ubuntu 24.04 (Noble Numbat)/Linux Mint 22/Zorin OS 18/elementary OS 8 (.deb)\",\"url\":\"${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-noble.deb\",\"link_type\":\"package\"}"
${RELEASE_LINKS_URL}'
- 'curl --request POST
--header "JOB-TOKEN: $CI_JOB_TOKEN"
--header "Content-Type: application/json"
--data "{\"name\":\"${PROJECT_NAME} - Ubuntu 25.04 (Plucky Puffin) (.deb)\",\"url\":\"${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}-v${CI_COMMIT_TAG}-plucky.deb\",\"link_type\":\"package\"}"
${RELEASE_LINKS_URL}'
# TODO: look into: https://docs.gitlab.com/cli/release/upload/