generated from libre-knowledge/subject-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
66 lines (62 loc) · 1.7 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
# GitLab CI configuration file
#
# References:
#
# * `.gitlab-ci.yml` keyword reference | GitLab
# https://docs.gitlab.com/ee/ci/yaml/
#
# Copyright 2023 林博仁(Buo-ren, Lin) <[email protected]>
# SPDX-License-Identifier: CC-BY-SA-4.0
do-static-analysis:
stage: test
rules:
- if: $CI_COMMIT_TAG == null
needs: []
image: ubuntu:22.04
variables:
PIP_CACHE_DIR: ${CI_PROJECT_DIR}/.cache/pip
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
SHELLCHECK_DIR: ${CI_PROJECT_DIR}/.cache/shellcheck-stable
cache:
# Enable per-job and per-branch caching
key: $CI_JOB_NAME-$CI_COMMIT_REF_SLUG
paths:
- ${PIP_CACHE_DIR}
- ${PRE_COMMIT_HOME}
- ${SHELLCHECK_DIR}
script:
- ./continuous-integration/do-static-analysis.install-system-deps.sh
- ./continuous-integration/do-static-analysis.sh
generate-build-artifacts:
stage: build
rules:
- if: $CI_COMMIT_TAG
needs: []
image: ubuntu:22.04
artifacts:
paths:
- ${CI_PROJECT_NAME}-*.tar*
script:
- ./continuous-integration/generate-build-artifacts.install-system-deps.sh
- ./continuous-integration/generate-build-artifacts.sh
upload-release-assets:
stage: deploy
rules:
- if: $CI_COMMIT_TAG
needs:
- generate-build-artifacts
image: curlimages/curl:latest
script:
- ./continuous-integration/upload-gitlab-generic-packages.sh
create-release:
stage: deploy
rules:
- if: $CI_COMMIT_TAG
needs:
- generate-build-artifacts
- upload-release-assets
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- apk add bash git
- ./continuous-integration/generate-release-description.sh
- ./continuous-integration/create-gitlab-release.sh