Commit 3539a685 authored by Teake Nutma's avatar Teake Nutma
Browse files

Use release-cli script explicitly

Passing env vars around doesn't work for the release keyword.
parent 7e08838b
......@@ -61,16 +61,22 @@ release_merge_and_tag:on-schedule:
release_gitlab:
stage: release
image: omegacen/ci-tools
variables:
GIT_DEPTH: 0
rules:
- if: $CI_COMMIT_TAG =~ /^\d{4}\.\d{2}\.\d+/
script:
# Determine the previous tag. This is a bit brittle because we're sorting lexicographically by tag name
# instead of topographically in the git tree. But since we're restricting to YYYY.MM.PATCH
# instead of topographically by commits in the git tree. But since we're restricting to YYYY.MM.PATCH
# tags, this should be ok.
- PREVIOUS_TAG=$(git tag --merged ${CI_COMMIT_SHA} | grep -E '^\d{4}.\d{2}.\d+$' | sort | tail -n 2 | head -n 1)
- PREVIOUS_TAG=$(git tag --merged ${CI_COMMIT_SHA} | grep -P '^\d{4}.\d{2}.\d+$' | sort | tail -n 2 | head -n 1)
- |
if [ -z "$PREVIOUS_TAG" ]; then
echo "Could not find previous tag, exiting"
false
fi
- echo "Found previous tag ${PREVIOUS_TAG}"
- PREVIOUS_TAG_SHA=$(git rev-parse "${PREVIOUS_TAG}")
- CHANGES=$(git log-mr --output markdown --pretty oneline --target "$CI_DEFAULT_BRANCH" "$PREVIOUS_TAG_SHA..$CI_COMMIT_SHA" | sort --ignore-case)
- DESCRIPTION='##### Changes'$'\n'$'\n'"$CHANGES"
release:
tag_name: "$CI_COMMIT_TAG"
description: "$DESCRIPTION"
- release-cli create --name "$CI_COMMIT_TAG" --description "$DESCRIPTION" --tag-name "$CI_COMMIT_TAG"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment