Skip to main content

Pipeline components component

This pipeline handles the management of a components project. It will create unstable releases, stable releases and provide a stable branch bound to the latest stable version.

Configure GITLAB_TOKEN with a group service account before enabling release automation.

Each commit in main will trigger the workflow to create a new release via semantic-release. Automatic configuration permits Maintainer pushes and merges to both the default branch and the configured release branch, reconciling their role-level protection while preserving explicit user/group grants. The configuration job creates the release branch from the default branch when it is missing. Other trunk-based consumers keep their no-direct-push default. In the first tagged pipeline a new commit is created with pinned versions in the codebase and then tagged with that version merged to stable. Finally, that commit is reverted in main to unpin it from latest version. All pushes are done with ci.skip to avoid triggering a new pipeline.

Automatic configuration always applies the Git notes workaround to an existing non-empty required commit-message expression. No parameter is needed; an absent expression stays absent and the negative rule is preserved.

Customize release rules​

Use release-rules to pass an array of commit analyzer rules to semantic-release. The default [] preserves existing analyzer rules and normal Conventional Commits behavior: features release minor, fixes patch and breaking changes major. For squash merges, check the final commit message and its body.

For example, this consumer can release breaking changes as minor:

include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/pipeline-components@stable
inputs:
release-rules:
- breaking: true
release: minor

Non-empty input replaces releaseRules on the configured commit analyzer, including in an existing .releaserc.json, while preserving its other options and plugins. Commits not matched by a custom rule still use the analyzer's default rules. Other projects retain their defaults unless they opt in. This does not make a breaking API compatible or restrict manually created tags.

Bugs​

Variables​

NamerequiredHints
GITLAB_TOKENnoNon-personal access token of a service account fallback to CI_JOB_TOKEN with limitations

Limitations of CI_JOB_TOKEN:

The current limitations of using CI_JOB_TOKEN are so severe that we recommend using GITLAB_TOKEN instead.

  • You can't trigger the wiki publishing.
  • Create pipeline not working, so you need to trigger the pipeline manually after pushing a commit to main or use a scheduled pipeline.
  • Cannot create comments on merge requests, so no release notes in merge requests.

Setup​

  • Create a new components catalog project
  • The pipeline creates stable from the default branch and protects it when automatic configuration is enabled.
  • Protect main and all tags *.
  • Create GitLab pipeline file .gitlab-ci.yml:
include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/pipeline-components@stable

Inputs​

NameDescriptionDefaultType
------------
autoconfigure-enabledEnable or disable the automatic configuration of the pipeline.trueboolean
documentation-pathPath to the documentation files./docsstring
nameThe name of the project to release${CI_PROJECT_NAME}string
needsThe jobs that this job depends on.[]array
release-branchThe branch to release fromstablestring
release-rulesCustom commit-analyzer release rules. An empty array preserves the configured analyzer rules and defaults.[]array
stageThe name of the stagereleasestring
tagsThe runners that this job depends on.[]array