2023-11-07 15:57:09 +01:00
|
|
|
---
|
2023-11-19 14:34:23 +01:00
|
|
|
stages: [checks, release]
|
2023-11-07 15:57:09 +01:00
|
|
|
|
2023-11-19 14:34:23 +01:00
|
|
|
check-commitizen:
|
2023-11-07 15:57:09 +01:00
|
|
|
# Check the current commit message for compliance with commitizen
|
2023-11-19 14:34:23 +01:00
|
|
|
stage: checks
|
2025-03-02 21:23:37 +00:00
|
|
|
image: nixpkgs/nix-flakes:latest
|
2023-11-19 14:34:23 +01:00
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
2023-11-07 15:57:09 +01:00
|
|
|
script:
|
2025-03-02 21:23:37 +00:00
|
|
|
- nix run nixpkgs#commitizen -- check --message "$CI_COMMIT_TITLE"
|
2023-11-07 15:57:09 +01:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
|
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
2023-11-19 14:34:23 +01:00
|
|
|
|
|
|
|
tag-to-release:
|
|
|
|
stage: release
|
|
|
|
# https://gitlab.com/gitlab-org/release-cli/-/blob/master/Dockerfile
|
|
|
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
script:
|
|
|
|
- apk add --no-cache --upgrade git py3-pip
|
2023-12-11 14:04:19 -05:00
|
|
|
# Pass --break-system-packages since since this containers sole purpose is
|
|
|
|
# running 2 applications. If we get to advance this, implement a proper venv
|
|
|
|
- pip install --break-system-packages -U commitizen
|
2023-11-19 14:34:23 +01:00
|
|
|
- git clone "$CI_PROJECT_URL.git"
|
|
|
|
- cd "$CI_PROJECT_NAME"
|
|
|
|
- CHANGELOG=$(cz changelog "$CI_COMMIT_TAG" --dry-run | sed /^Invalid/d)
|
|
|
|
- release-cli create --name "$CI_COMMIT_TAG" --description "$CHANGELOG" --tag-name "$CI_COMMIT_TAG"
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG != null
|