-
-
Notifications
You must be signed in to change notification settings - Fork 593
/
.gitlab-ci.yml
187 lines (180 loc) · 5.47 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
# You can override the included template(s) by including variable overrides
# See https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#priority-of-environment-variables
image: registry.gitlab.com/remmina/remmina/ubuntu:22.04
stages:
- test
- build
- triage
variables:
GIT_SUBMODULE_STRATEGY: recursive
BUILD_FOLDER: build
DEB_PPA: ppa:remmina-ppa-team/remmina-next
FREERDP_DAILY_PPA: ppa:remmina-ppa-team/remmina-next-daily
DOCKER_IMAGE: ubuntu:latest
CMAKE_BUILD_OPTIONS: "-DCMAKE_BUILD_TYPE=Release -DWITH_APPINDICATOR=on -DWITH_FREERDP3=OFF"
FLATPAK_ARCH: x86_64
cache: &global_cache
key: ${CI_JOB_NAME}
policy: pull-push
before_script:
- mkdir -p .flatpak-builder/cache
ubuntu:devel:
stage: test
before_script:
- apt-get update -qq
- apt-get install -y -qq libpcre2-8-0 libpcre2-dev python3 python3-dev
script:
- mkdir $BUILD_FOLDER
- cmake -B$BUILD_FOLDER -H. $CMAKE_BUILD_OPTIONS
- make VERBOSE=1 -C $BUILD_FOLDER
only:
refs:
- master
- tags
- merge_requests
- web
except:
refs:
- schedules
flatpak:test:
image: registry.gitlab.com/remmina/remmina/ubuntu:22.04
stage: test
variables:
BUNDLE: remmina-dev.flatpak
FLATPAK_PPA: ppa:alexlarsson/flatpak
FLATHUB_REPO: https://dl.flathub.org/repo/flathub.flatpakrepo
before_script:
- apt-get update -qq
- apt-get install -y -qq flatpak-builder flatpak build-essential git-core
- flatpak --user remote-add --if-not-exists flathub $FLATHUB_REPO
- git config --global protocol.file.allow always
script:
- "/bin/sh -xe ./flatpak/flatpak-build.sh"
artifacts:
expose_as: Download the flatpak
paths:
- flatpak/remmina-dev.flatpak
expire_in: 7 days
cache:
<<: *global_cache
paths:
- flatpak/.flatpak-builder/cache/
- flatpak/.flatpak-builder/ccache/
- flatpak/.flatpak-builder/downloads/
- flatpak/.flatpak-builder/git/
only:
refs:
- merge_requests
- tags
- web
except:
refs:
- schedules
snap:build:
image: registry.gitlab.com/remmina/remmina/snap:22.04
stage: build
before_script:
- apt-get update -qq
script:
- apt-get install -y git
- mkdir -p ~/.local/share/snapcraft/provider/launchpad
- echo -en "[1]\n" > ~/.local/share/snapcraft/provider/launchpad/credentials
- echo -en "consumer_key = System-wide" >> ~/.local/share/snapcraft/provider/launchpad/credentials
- echo -en ":" >> ~/.local/share/snapcraft/provider/launchpad/credentials
- echo -en " Ubuntu (ubuntu)\n" >> ~/.local/share/snapcraft/provider/launchpad/credentials
- echo -en "consumer_secret = \n" >> ~/.local/share/snapcraft/provider/launchpad/credentials
- echo -en "access_token = " >> ~/.local/share/snapcraft/provider/launchpad/credentials
- echo -en $LAUNCHPAD_CREDENTIALS_ACCESS_TOKEN >> ~/.local/share/snapcraft/provider/launchpad/credentials
- echo -en "\naccess_secret = " >> ~/.local/share/snapcraft/provider/launchpad/credentials
- echo -en $LAUNCHPAD_CREDENTIALS_ACCESS_SECRET >> ~/.local/share/snapcraft/provider/launchpad/credentials
- echo -en "\n" >> ~/.local/share/snapcraft/provider/launchpad/credentials
- snapcraft remote-build --launchpad-accept-public-upload
- |
if ls remmina_*_amd64.snap 1> /dev/null 2>&1; then
echo "amd64 snap file found"
else
echo "amd64 snap file not found"
cat remmina_amd64.txt
exit 1
fi
- |
if ls remmina_*_arm64.snap 1> /dev/null 2>&1; then
echo "arm64 snap file found"
else
echo "arm64 snap file not found"
cat remmina_arm64.txt
exit 1
fi
- |
if ls remmina_*_armhf.snap 1> /dev/null 2>&1; then
echo "armhf snap file found"
else
echo "armhf snap file not found"
cat remmina_armhf.txt
exit 1
fi
- |
if [ "$CI_COMMIT_REF_NAME" = "master" ]; then
echo $SNAPCRAFT_LOGIN | base64 --decode --ignore-garbage > snapcraft.login
snapcraft login --with snapcraft.login
snapcraft upload remmina*_amd64.snap --release edge
snapcraft upload remmina*_arm64.snap --release edge
snapcraft upload remmina*_armhf.snap --release edge
snapcraft logout
fi
timeout: 8h 0m
allow_failure: false
artifacts:
paths:
- "./*.snap"
- "./remmina_*.txt"
expire_in: 10 days
only:
refs:
- tags
- merge_requests
- web
except:
refs:
- schedules
trigger_build:
stage: build
before_script:
- apt-get update -qq
- apt-get install -y -qq curl
script:
- curl -X POST -F token=$CITOKEN -F ref=master https://gitlab.com/api/v4/projects/10530342/trigger/pipeline
except:
- schedules
trigger_ppa:
stage: build
before_script:
- apt-get update -qq
- apt-get install -y -qq curl
script:
- curl -X POST -F token=$PPACITOKEN -F ref=master https://gitlab.com/api/v4/projects/6725270/trigger/pipeline
only:
- tags
- web
except:
- schedules
#dry-run:triage:
# image: ruby:2.7
# stage: triage
# script:
# - gem install gitlab-triage
# - gitlab-triage --help
# - gitlab-triage --dry-run --token $RM_TRIAGE_TOKEN --host-url $CI_SERVER_URL --source projects --source-id $CI_PROJECT_PATH
# when: manual
# except:
# - schedules
run:triage:
image: ruby:3.2
stage: triage
script:
- gem install gitlab-triage
- gitlab-triage --token $RM_TRIAGE_TOKEN --host-url $CI_SERVER_URL --source projects --source-id $CI_PROJECT_PATH
only:
- schedules