gitlab: Add CI script to create a release.

This commit is contained in:
Alexandre Julliard 2022-07-26 15:27:46 +02:00
parent 104d6a1205
commit aa222ccd32
2 changed files with 25 additions and 0 deletions

View file

@ -3,7 +3,9 @@
stages:
- image
- build
- deploy
include:
- local: "/tools/gitlab/image.yml"
- local: "/tools/gitlab/build.yml"
- local: "/tools/gitlab/release.yml"

23
tools/gitlab/release.yml Normal file
View file

@ -0,0 +1,23 @@
# CI script for creating releases
create-release:
stage: deploy
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG && $CI_PROJECT_PATH == "wine/wine"
script:
- VERSION=$(expr "$CI_COMMIT_TAG" ":" 'wine-\(.*\)')
- URL=$(grep -o "https://dl.winehq.org/.*" ANNOUNCE)
- FILEPATH=$(expr "$URL" ":" '.*\(/.*\)')
- |
sed -e '/^The source/,/^----------/d
/^----------/,$d
/^Bugs fixed/i--------
s/^ *\([0-9][0-9]*\) / - #\1/
s/^\*\*\*/###/' ANNOUNCE >announce.md
- release-cli create
--name "Wine $VERSION"
--tag-name "$CI_COMMIT_TAG"
--released-at "$CI_COMMIT_TIMESTAMP"
--description announce.md
--assets-link "{\"name\":\"Source code\",\"url\":\"$URL\",\"link_type\":\"other\",\"filepath\":\"$FILEPATH\"}"