-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
70 lines (65 loc) · 2.93 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
image: danger89/cmake:5.2
stages:
- test
- build
- release
static_code_analysis:
stage: test
script:
- cppcheck --version
- ./scripts/cpp_check.sh
code_style_guidelines:
stage: test
script:
- clang-format --version
- ./scripts/check_format.sh
build:
stage: build
script:
- ./scripts/build_prod.sh
- ./scripts/create_source_archive.sh
artifacts:
name: "RamBam"
expire_in: 4 weeks
paths:
- build_prod/RamBam-*.deb
- build_prod/RamBam-*.rpm
- build_prod/RamBam-*.tar.gz
- build_prod/RamBam-Source-*.tar.gz
upload_and_release:
stage: release
variables:
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/rambam/${CI_COMMIT_TAG}"
RELEASE_LINKS_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/${CI_COMMIT_TAG}/assets/links"
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG && $CI_PROJECT_NAMESPACE == "melroy"
script:
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build_prod/RamBam-v${CI_COMMIT_TAG}.deb
${PACKAGE_REGISTRY_URL}/RamBam-v${CI_COMMIT_TAG}.deb'
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build_prod/RamBam-v${CI_COMMIT_TAG}.rpm
${PACKAGE_REGISTRY_URL}/RamBam-v${CI_COMMIT_TAG}.rpm'
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build_prod/RamBam-v${CI_COMMIT_TAG}.tar.gz
${PACKAGE_REGISTRY_URL}/RamBam-v${CI_COMMIT_TAG}.tar.gz'
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build_prod/RamBam-Source-v${CI_COMMIT_TAG}.tar.gz
${PACKAGE_REGISTRY_URL}/RamBam-Source-v${CI_COMMIT_TAG}.tar.gz'
- 'curl --header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" --header "Content-Type: application/json"
--request POST --data "{\"name\":\"RamBam (Compressed binary)\",\"url\":\"${PACKAGE_REGISTRY_URL}/RamBam-v${CI_COMMIT_TAG}.tar.gz\",\"link_type\":\"package\"}"
${RELEASE_LINKS_URL}'
- 'curl --header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" --header "Content-Type: application/json"
--request POST --data "{\"name\":\"RamBam (Red-Hat/Fedora/openSUSE)\",\"url\":\"${PACKAGE_REGISTRY_URL}/RamBam-v${CI_COMMIT_TAG}.rpm\",\"link_type\":\"package\"}"
${RELEASE_LINKS_URL}'
- 'curl --header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" --header "Content-Type: application/json"
--request POST --data "{\"name\":\"RamBam (Debian/Ubuntu/Linux Mint)\",\"url\":\"${PACKAGE_REGISTRY_URL}/RamBam-v${CI_COMMIT_TAG}.deb\",\"link_type\":\"package\"}"
${RELEASE_LINKS_URL}'
- 'curl --header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" --header "Content-Type: application/json"
--request POST --data "{\"name\":\"RamBam Code Source Archive (tar.gz)\",\"url\":\"${PACKAGE_REGISTRY_URL}/RamBam-Source-v${CI_COMMIT_TAG}.tar.gz\",\"link_type\":\"package\"}"
${RELEASE_LINKS_URL}'
#unit_test:
# stage: test
# script: ./build_prod/bin/runTests
# cache:
# key: "$CI_PIPELINE_ID"
# policy: pull
# paths:
# - build_prod/bin/