-
Notifications
You must be signed in to change notification settings - Fork 61
/
.gitlab-ci.yml
126 lines (112 loc) · 2.97 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
## Jobs to build and publish deb, rpm and arch based packages
include:
- project: 'ProtonVPN/Linux/v3/_gitlab-ci'
ref: public-protonvpn-repo
file: 'message-deploy.yml'
- project: 'ProtonVPN/Linux/v3/_gitlab-ci'
ref: public-protonvpn-repo
file: 'gitlab-ci-build-publish-debian.yml'
- project: 'ProtonVPN/Linux/v3/_gitlab-ci'
ref: public-protonvpn-repo
file: 'gitlab-ci-build-publish-rpm.yml'
- project: 'ProtonVPN/Linux/v3/_gitlab-ci'
ref: public-protonvpn-repo
file: 'gitlab-ci-build-publish-arch.yml'
- project: 'agarroux/publish-github'
ref: master
file: '/jobs/release.gitlab-ci.yml'
default:
image: $CI_REGISTRY_IMAGE:branch-$CI_COMMIT_REF_SLUG
stages:
- image
- test
- build
- publish
- message
- image-latest
- release
variables:
CI_REGISTRY_IMAGE_PROTON: "$CI_REGISTRY/infra/kubernetes/images"
PKGNAME_ARCH: "python-proton-client"
PKGNAME_RPM: "python3-proton-client"
ORIGINAL_PKGNAME: "proton-python-client"
######### Manage the Image ##########
.common-image:
tags:
- medium
image: $CI_REGISTRY/infra/kubernetes/images/docker:stable
interruptible: true
variables:
DOCKER_HOST: tcp://docker:2375
services:
- name: $CI_REGISTRY/infra/kubernetes/images/docker:dind
alias: docker
before_script:
- apk update
- apk add make bash git gawk rsync
make-image-deb:
stage: image
tags:
- medium
extends: .common-image
except:
- schedules
- triggers
script:
- make image-deb branch=$CI_COMMIT_REF_SLUG src=ubuntu
# Make image when we push to a branch -> run tests on top of this one
make-image-arch:
stage: image
extends: make-image-deb
script:
- make image-arch branch=$CI_COMMIT_REF_SLUG src=archlinux || true
make-image-fed38:
stage: image
extends: make-image-deb
script:
- make image-fed38 branch=$CI_COMMIT_REF_SLUG src=fedora38
######## CI Test Jobs ##########
test-deb:
tags:
- medium
stage: test
image: $CI_REGISTRY_IMAGE/ubuntu:branch-$CI_COMMIT_REF_SLUG
interruptible: true
needs:
- job: make-image-deb
script:
- python3 -m pytest
test-arch:
extends: test-deb
needs:
- job: make-image-arch
image: $CI_REGISTRY_IMAGE/archlinux:branch-$CI_COMMIT_REF_SLUG
allow_failure: true
test-fed38:
extends: test-deb
needs:
- job: make-image-fed38
image: $CI_REGISTRY_IMAGE/fedora38:branch-$CI_COMMIT_REF_SLUG
## Jobs to publish commits + tags from master to github
release-publish-github:
stage: release
needs:
- job: build-deb
- job: build-fed38
when: manual
variables:
RELEASE_SYNC_PUBLIC_URL: git@github.com:ProtonMail/proton-python-client.git
RELEASE_SYNC_TO_BRANCH: 'master'
RELEASE_SYNC_FROM_BRANCH: 'master'
extends: .release-sync-commit-shared
release-publish-github-tags:
stage: release
needs:
- job: build-deb
- job: build-fed38
when: manual
variables:
RELEASE_SYNC_PUBLIC_URL: git@github.com:ProtonMail/proton-python-client.git
RELEASE_SYNC_TO_BRANCH: 'master'
RELEASE_SYNC_FROM_BRANCH: 'master'
extends: .release-sync-tags-shared