Select Git revision
.gitlab-ci.yml
.gitlab-ci.yml 1.89 KiB
stages:
- release
start_release:
image: golang:1.22.0-alpine3.18
stage: release
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
- if: $CI_PIPELINE_SOURCE == "web"
when: manual
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
before_script:
- apk --no-cache add git
script:
- echo "Start release for perxis-proto"
- echo LAST_VERSION=$(git describe --tags --abbrev=0) >> vars.env
artifacts:
reports:
dotenv: vars.env
get_release_info:
stage: release
image:
name: orhunp/git-cliff:latest
entrypoint: [ "" ]
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
- if: $CI_PIPELINE_SOURCE == "web"
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
script:
- echo "VERSION=$(git-cliff --bumped-version)" >> vars.env
- echo "$(git-cliff --unreleased | sed '1,6d' | sed '$d')" > CHANGELOG.md
artifacts:
reports:
dotenv: vars.env
paths:
- CHANGELOG.md
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
- if: $CI_PIPELINE_SOURCE == "web"
needs:
- job: start_release
artifacts: true
- job: get_release_info
artifacts: true
script:
- echo "PERXIS_PROTO_RELEASE_VERSION=$VERSION" >> vars.env
- |
if [ "$VERSION" == "$LAST_VERSION" ]; then
exit 204
fi
# # TODO Убрать при влитии feature-ветки в мастер
# release:
# name: "Release $VERSION"
# tag_name: "$VERSION"
# description: "$VERSION"
allow_failure:
exit_codes:
- 204
artifacts:
when: always
paths: