-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
66 lines (59 loc) · 1.49 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
stages:
- build
- deploy
debian package:
stage: build
image: debian:bullseye
script:
- apt update
- apt install -y dh-make dh-exec
- dpkg-buildpackage -us -uc
- mkdir build
- mv ../agdsn-zsh-config*.deb build/
# The files which are to be made available in GitLab
artifacts:
paths:
- build/*
expire_in: 1 week
rpm package:
stage: build
image: rockylinux:8
script:
- dnf install -y rpm-build
- >
rpmbuild -bb rpm/agdsn-zsh-config.spec
--define "_topdir $(pwd)/rpm/build"
--define "_sourcedir $(pwd)"
- mkdir build
- mv rpm/build/RPMS/noarch/agdsn-zsh-config*.rpm build/
artifacts:
paths:
- build/*
expire_in: 1 week
.deploy_rules:
rules:
# deploy only if the commit is tagged with a version (e.g. 'v0.1.2')
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/
debian deploy:
stage: deploy
needs: ["debian package"]
script:
- >
curl --fail
-u $nexus_username:$nexus_password
-H "Content-Type: multipart/form-data"
--data-binary "@$(realpath build/agdsn-zsh-config*.deb)"
https://nexus.agdsn.network:8443/repository/agdsn-apt/
rules:
- !reference [.deploy_rules, rules]
rpm deploy:
stage: deploy
needs: ["rpm package"]
script:
- >
curl --fail --insecure
-u $nexus_username:$nexus_password
--upload-file build/agdsn-zsh-config*.rpm
https://nexus.agdsn.network:8443/repository/agdsn-rpm/
rules:
- !reference [.deploy_rules, rules]