-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
101 lines (93 loc) · 3.01 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
include:
- project: 'clci/gitlab-ci'
ref: v2-stable
file:
- definitions.gitlab-ci.yml
- guarded-linux-test-pipeline.gitlab-ci.yml
- guarded-release-pipeline.gitlab-ci.yml
- guarded-clpm-dep-update-pipeline.gitlab-ci.yml
variables:
# Neither of these have package local nickname support.
CLCI_TEST_CLISP: "no"
CLCI_TEST_CMUCL: "no"
CLCI_ABCL_TAG: "jdk8"
# This section is not strictly required, but prevents Gitlab CI from launching
# multiple redundent pipelines when a Merge Request is opened.
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
- if: '$CI_COMMIT_TAG'
# Build the docs and upload them to Gitlab.
generate docs:
extends:
- .clci sbcl
- .clci clpm script
variables:
CLCI_SCRIPT: scripts/generate-docs.lisp
artifacts:
paths:
- docs/
# Notify the project containing the website that new documentation is ready to
# be fetched.
publish docs:
stage: deploy
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+(\.[0-9]+)*(-.*)?$/'
needs:
- "blocker:release:clci"
- "generate docs"
trigger: cl-tar/cl-tar.common-lisp.dev
variables:
CL_TAR_TAG: $CI_COMMIT_TAG
CL_TAR_PIPELINE: $CI_PIPELINE_ID
build static release:
image: daewok/static-sbcl:2.1.9-alpine3.13
extends:
- .clci sbcl
- .clci clpm script
variables:
CLCI_ASDF_VERSION: "3.3.4"
CLCI_SCRIPT: scripts/build-static-release.lisp
before_script:
- apk add curl ca-certificates git pkgconfig gcc musl-dev linux-headers zlib-dev zlib-static make
artifacts:
paths:
- releases/
# This is needed because golang's parameter substitution is crippled (no #) and
# gitlab's package registries can't accept a version string that starts with a
# v.
compute friendly version:
image: alpine:3.13
script:
- echo "PACKAGE_VERSION=${CI_COMMIT_TAG#v}" > release.env
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+(\.[0-9]+)*(-.*)?$/'
artifacts:
reports:
dotenv: release.env
publish static release:
image: curlimages/curl
script:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file releases/static/cl-tar-${PACKAGE_VERSION}-linux-amd64.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/$CI_PROJECT_NAME/${PACKAGE_VERSION}/cl-tar-${PACKAGE_VERSION}-linux-amd64.tar.gz"'
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+(\.[0-9]+)*(-.*)?$/'
needs:
- "blocker:release:clci"
- "compute friendly version"
- "build static release"
gitlab:release:clci:
release:
assets:
links:
- name: 'linux-amd64 binary'
url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/$CI_PROJECT_NAME/${PACKAGE_VERSION}/cl-tar-${PACKAGE_VERSION}-linux-amd64.tar.gz"
filepath: '/binaries/cl-tar-linux-amd64'
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+(\.[0-9]+)*(-.*)?$/'
needs:
- "blocker:release:clci"
- "extract changelog:release:clci"
- "compute friendly version"