Newer
Older
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
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Produce a new release using semantic versionning scheme when new
# commits arrive on the production branch.
#
# USAGE
# =====
#
# include:
# - project: EOLE/infra/ci-tools
# ref: stable
# file: /templates/Release/Semantic-release.yaml
#
# REQUIREMENTS
# ============
#
# - A `release` stage must be present in your pipeline
# - One of the `semantic-release` configuration file must be present
# - `release.config.js`
# - `.releaserc`
# - `.releaserc.js`
# - `.releaserc.json`
# - `.releaserc.yaml`
# - `.releaserc.yml`
# - an access token named `GITLAB_TOKEN` with
# - `api`
# - `read_repository`
# - `write_repository`
# - The variable `$STABLE_BRANCH` defined
#
# OPTIONAL VARIABLES
# ==================
#
# - `SEMANTIC_RELEASE_IMAGE`: name of the `semantic-release` docker
# image to use
#
# SEE ALSO
# ========
#
# - Semantic release software: https://github.com/semantic-release/semantic-release/
# - Commitlint: https://github.com/conventional-changelog/commitlint/
#
# IMPORTANT NOTE
# ==============
#
# We can't merge rules with `!reference` until we switch to Gitlab >= 14.3
# https://gitlab.com/gitlab-org/gitlab/-/issues/322992
.on-stable-with-semantic-release-config:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
# Exclude semantic-release commits on $STABLE_BRANCH
- if: $CI_COMMIT_BRANCH == $STABLE_BRANCH && $CI_COMMIT_MESSAGE =~ /^chore\(release\):/
when: never
- if: $CI_COMMIT_BRANCH == $STABLE_BRANCH
exists:
- release.config.js
- .releaserc
- .releaserc.yaml
- .releaserc.yml
- .releaserc.json
- .releaserc.js
when: on_success
semantic-release:
stage: release
extends: .on-stable-with-semantic-release-config
image: "$SEMANTIC_RELEASE_IMAGE"
variables:
SEMANTIC_RELEASE_IMAGE: 'hub.eole.education/eole/semantic-release-gitlab:latest'
script:
- 'semantic-release'
...