ci: Add script to create the gitlab release.

Copied from the corresponding Wine script.
This commit is contained in:
Alexandre Julliard 2023-09-22 11:02:32 +02:00
parent 803dfc1246
commit 8d83b2eaec
Notes: Alexandre Julliard 2023-12-06 23:24:25 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/360
2 changed files with 19 additions and 0 deletions

View File

@ -2,8 +2,10 @@ stages:
- image
- build
- test
- deploy
include:
- local: "/gitlab/image.yml"
- local: "/gitlab/build.yml"
- local: "/gitlab/test.yml"
- local: "/gitlab/release.yml"

17
gitlab/release.yml Normal file
View File

@ -0,0 +1,17 @@
# 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/vkd3d"
script:
- VERSION=$(expr "$CI_COMMIT_TAG" ":" 'vkd3d-\(.*\)')
- test -n "$VERSION" || exit 1
- URL=$(grep -o "https://dl.winehq.org/[^>]*" ANNOUNCE)
- FILEPATH=$(expr "$URL" ":" '.*\(/.*\)')
- release-cli create
--name "vkd3d $VERSION"
--tag-name "$CI_COMMIT_TAG"
--description ANNOUNCE
--assets-link "{\"name\":\"Source code\",\"url\":\"$URL\",\"link_type\":\"other\",\"filepath\":\"$FILEPATH\"}"