CI: Add automated monthly releases

See be63f0bd82
This commit is contained in:
saibotk 2021-03-05 13:38:40 +01:00
parent 431ed0084e
commit 4840fb3cac
Signed by: saibotk
GPG key ID: 67585F0065E261D5

View file

@ -7,6 +7,7 @@ image: registry.git.saibotk.de/saibotk.de/infrastructure-ci-container:latest
stages:
- lint
- test
- release
ansible-lint:
stage: lint
@ -15,3 +16,18 @@ ansible-lint:
artifacts:
reports:
codequality: ansible-lint-report.json
# Automated month-based releases
release-branch:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
script:
- apk add --no-cache git
- export INFRA_RELEASE_VERSION="$(date +%y.%m)"
- export INFRA_RELEASE_NAME="Infrastructure $INFRA_RELEASE_VERSION"
- export INFRA_RELEASE_DESCRIPTION="$(printf '## Changelog\n\n' && git log --no-merges --pretty="- %s (%h)" "HEAD...$(git tag | sort -V -r | head -1)" && printf '\n\n## External Contributors\n\n' && git log --pretty="- %an%n- %cn" HEAD...$(git tag | sort -V -r | head -1) | sort | uniq | grep -v 'Sheogorath' && printf "\n\n---\n*This is an automated release. See [#${CI_JOB_ID}]($CI_JOB_URL) for details.*")"
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $INFRA_RELEASE_NOW == "true" && $CI_COMMIT_TAG == null'